|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming N2 {( c+ l& p7 R! J8 r- O
Shanghai - 2007
" z' m' G; C& u+ EAssignment 2
) W4 B4 T4 h/ g! {7 ?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)
/ L5 a! }& [& g N6 [" P2 B7 x1. 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.
3 I5 `( E: a$ I1 U1 B; Z5 iThe staff must be able to:$ w) O+ j" d" M: y# Z7 H3 `
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! z* g f$ F2 Y" N0 _# {/ X1. 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.
# e1 |" v5 M( K& D4 o The interface should provide a menu so that the staff can:' C2 \2 _# ?5 x. P- m# F, r; j
a) Enter the names of the two Java program files to be compared! S8 Q7 s9 L* @! t9 Q8 y
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.% H: a1 G+ B6 v; h) d
** 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).. s$ F. `: c* C* |4 a8 ?
BSA104 Business Programming – 2007: Assignment 2
0 B6 c; q( _4 P& r5 a: H4 h9 WPage 2 of 5
) v/ S1 v" j: g8 ~' b" `# Wb) Print out to the screen all the lines of code that are the same
0 A; d0 X5 D( e# e/ ` Include the name of the file and the line number of the code being printed for each of the two files
3 a/ k: v9 P) Gc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared. X1 \$ B1 F. O7 O
 the name, username and department of the user
' G! L A# \5 \# J the statistics of the comparison
( V6 f9 ?9 D. b# B# T$ y- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different6 E4 d* P8 r- s: e/ c. v+ }- Y
 the recommendation for further checking+ O, c z% g* x/ l& ?7 t
- 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 closely0 p$ N6 f8 S0 @/ Y
 the names of the two files compared2 r6 i1 Q7 n' h; }
d) Leave the program (exit)2 [% e, _/ Y9 K1 q2 T! E# M
The ProgramCompare class: (Total maximum 20 marks available), g% K) x- Q6 \7 W
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)# [' k" g/ r: f+ F4 ?% b. x2 a
a) provide an error message if the files are not found or there is a problem opening them
% |% p+ z; o4 h4 ]& [& _b) compare each line of code
3 B j5 o3 ]2 C" y8 S2 |c) print out the lines that are the same
& F7 `) h7 Z# G3 N- Y: yd) count the number of lines compared / lines the same
" T- a0 D! X1 Y ^The AuthorisedUsers class: (Total maximum 20 marks available)( G+ g1 r; |3 r
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)6 g: v% z) E8 V! |* S A
4. Provide methods to:0 \% Z9 g! d# M( R6 K
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
1 r+ y& [7 @! M# Ob) return the name of the authorised user
( _* D: Q7 y. t( }' ]9 fc) return the name of the department of the authorised user
1 c! T) w) y& m1 _5 GIndividual Data (Maximum 20 marks available)& j9 p$ q: H3 |4 O
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.
4 A% x+ I# A* r$ j+ eDocumentation (Maximum 10 marks available); k3 U `7 d" q& N5 R* g( C% Y7 f
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., r/ ~5 m0 m: @/ W
BSA104 Business Programming – 2007: Assignment 2
$ e7 Q- J, Q+ {, p* [. _, XPage 3 of 5 |
|