|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
- ^2 M' e6 y- Q3 m# j! ^ PShanghai - 2007
; R, a# H' ~) GAssignment 2* o8 O: [% M4 U) T& y- R
Deadline for Submission: 10:00 pm (Shanghai time), Tuesday 15th May 2007 Assessment Weighting: 20% of the total assessment for BSA104 Assignment Type: Individual Scenario: The teaching staff at a nearby university are concerned that some of their students are submitting other students‟ work. They need a simple Java program that will compare the text of two other Java programs, line by line, for equality, and then print out the results, and a recommendation. Requirements: Consider the three Java Classes: ProgramCompareMenu.java, ProgramCompare.java and AuthorisedUsers.java, available from the Assignment 2 page on Vista. You are required to perform the following tasks: The ProgramCompareMenu class: (Total maximum 20 marks available)
: b" k) ]( L% C5 g& N3 L! e8 |: v1. Provide a basic text-based menu interface to the ProgramCompare class so that it can be used by two staff members to determine if the two supplied Java programs are the same or similar.: k* `9 }- D; l) W2 G9 n
The staff must be able to:
5 \9 ^9 }- Z1 R) D l Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
0 Z- P; R, u5 q6 f4 s1. The user should not be able to use the „system‟ until they have provided the correct user name and PIN combination. You should give them a second or third chance to get it right before shutting the „system‟ down.
/ `# n, H- {) K( s6 N The interface should provide a menu so that the staff can:7 Q& x4 Z7 t& H& F
a) Enter the names of the two Java program files to be compared6 z6 o* O6 X- K$ o" ^
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.) e9 p) x1 @2 ]3 ^
** You must use the two user names and PINs provided in your individual data available from the Assignment 2 page on Vista (see requirement 5 below). The user names and PINs should be included in your code, and the output to the screen should prompt the user with the user names and passwords (for marking purposes).
# `0 | e0 }9 fBSA104 Business Programming – 2007: Assignment 2( ^! c: G V4 Y
Page 2 of 5
7 B1 _4 o1 u- o8 A/ o- ^b) Print out to the screen all the lines of code that are the same X0 V. ~1 L- K M t* s
 Include the name of the file and the line number of the code being printed for each of the two files' P9 Z* m3 j+ e
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
2 n7 c; f, P! C2 Z# Z the name, username and department of the user
( n9 c- [' X+ y- l* m0 q9 G the statistics of the comparison3 E. _' d l N1 r
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
& R; s* J" a& b# s. l) }) L3 T the recommendation for further checking$ p* D8 Y: Z' `% z2 z1 a% l( E* w
- For example: if more than 5 (five) lines of code are the same in each Java program file, then print a recommendation to the screen that the staff member check the files more closely7 `" H. z/ I& c3 }, }
 the names of the two files compared
: `2 v2 |" u G; i: {1 E& Ad) Leave the program (exit)
& {8 O, Y) n' XThe ProgramCompare class: (Total maximum 20 marks available)2 L7 O6 s6 i! d4 s% i3 A
2. Provide a method/s to read in each line of code from the two files identified by the user: (assumed that the two Java program files are in the same folder as your program): v# q7 c1 ~' r# L/ n3 W& {
a) provide an error message if the files are not found or there is a problem opening them
* \3 |( s' N ~b) compare each line of code
/ B1 {4 c& ] z, g& i* X7 B" o hc) print out the lines that are the same
' W% V% Z' s5 q: Y; |d) count the number of lines compared / lines the same9 f# h) C2 I/ z$ M: H$ i
The AuthorisedUsers class: (Total maximum 20 marks available)) P% z+ X( P* [# F# G
3. Provide an object that contains the name, username, PIN, and Department of the authorised users of the program (user names and PINs as provided in your individual data - see requirement 5 below)
! W8 F( X! [& D! w( n4. Provide methods to:$ ?5 A* t7 U; k, Q! n" v4 O
a) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match
* b5 T% C5 v$ i7 D. d* b6 N1 xb) return the name of the authorised user
# S& m1 E# H/ @. x) A2 p0 b. S6 M% S# yc) return the name of the department of the authorised user- u' ^2 n3 {: a2 h$ O
Individual Data (Maximum 20 marks available)
+ G; [1 H7 B: m2 }5. You will be given two staff member names, usernames, PINs, and department name, plus a set of two Java program files to compare using your program. You will need to log onto the BSA104 Assignment 2 page on Vista to generate your individual data and instructions for this requirement. You will need to use your University of Tasmania (UTas) student number.
% u0 y. ?7 }+ Q! T0 U: aDocumentation (Maximum 10 marks available)
. R7 t1 e: y% ~; ~" \6. Your program files should be fully documented, at least to the same standard as demonstrated in the textbook. This includes in-code comments, descriptions, and where appropriate, explanations for each new constructor, method and variable.3 ]( {7 A8 |$ J, I; Z% |6 f
BSA104 Business Programming – 2007: Assignment 29 p' J3 x. y; S
Page 3 of 5 |
|