|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming2 k6 G: D Z) K2 o3 J
Shanghai - 2007
4 K2 d) m$ [9 s8 h* C% d, eAssignment 27 D- F+ n k T4 O
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)7 E# k: W2 T# i& g( L6 b
1. 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.0 I- |, R' L- a0 d' K1 n4 j8 v% @
The staff must be able to:
- p( w8 r- V/ ?0 t Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.- ]* v3 W* ^* Z( u: j6 {& e v% N
1. 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.
; b+ k+ P& y* K. d2 \/ Q# j, Q The interface should provide a menu so that the staff can:
0 A f- P; l3 l) L: m$ Ma) Enter the names of the two Java program files to be compared. y) r! X) u2 z8 |0 N. N
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
% V5 f/ K: L/ h2 d! w7 _** 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).
: g8 N! U2 C; ?& kBSA104 Business Programming – 2007: Assignment 2; v3 J' G1 r2 B: c6 `9 P% q" T0 J3 p
Page 2 of 5
q( H: a4 `' A) D$ z" e/ k+ Cb) Print out to the screen all the lines of code that are the same# n4 ]" \7 m5 v/ B
 Include the name of the file and the line number of the code being printed for each of the two files
5 M* C. ?" N, w2 c4 n0 Y6 Ec) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared3 T4 w! a4 M4 f q' `6 a K/ i; @
 the name, username and department of the user3 c" a+ z; V2 V" A9 Q8 i8 ^
 the statistics of the comparison
7 l, G1 v3 o9 F+ M0 O# e- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
+ \) `: Q6 ~0 u8 ] z' j the recommendation for further checking
& F$ r3 h& g1 S7 Z/ B+ |9 ]- 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 closely1 S8 \# D: s# p H' _
 the names of the two files compared6 j% N; n% V! O& H; r, j" W
d) Leave the program (exit)2 u, A' r" S0 Y, \7 }! }
The ProgramCompare class: (Total maximum 20 marks available)6 x7 a5 L9 Z0 m$ {/ X r
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)
$ m1 \' [5 T1 F- |+ Ka) provide an error message if the files are not found or there is a problem opening them! V2 y/ ~( F: _% u: `9 I" F0 ?- F9 z
b) compare each line of code1 |, v, Q Q) q6 o) h
c) print out the lines that are the same9 m8 Q) J2 H0 @
d) count the number of lines compared / lines the same
/ p' C. I$ Q: O' {The AuthorisedUsers class: (Total maximum 20 marks available)4 f0 u/ j$ B: c( L
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)$ P8 P4 K+ ]1 J* Z4 M- \) j
4. Provide methods to:1 E. N6 L& F; q3 c) e# h
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% K! `- x+ ]1 z! G* ]! I
b) return the name of the authorised user
! H; _6 n) U4 Z' fc) return the name of the department of the authorised user) j+ f- e. E: P! {0 x; i
Individual Data (Maximum 20 marks available)
7 p+ M+ b# Y% m7 s8 W3 Y: a5. 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.% a j) \3 G# }, p' h: a o6 s
Documentation (Maximum 10 marks available)
% Y" ]3 u3 B# n3 I; T- q( Z6. 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.1 J$ M9 A4 r# d. u7 k- O$ i+ K
BSA104 Business Programming – 2007: Assignment 25 k3 b7 `' C8 V" n* Q
Page 3 of 5 |
|