|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming( z. t# e5 k9 }* {) ^9 _
Shanghai - 2007
[$ i6 L8 H# |9 a3 B5 vAssignment 2
1 E% V/ A4 r8 c7 {: m/ r# e+ Q7 m4 s! DDeadline 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)
- L* u0 {4 \9 {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.: F" h1 W \$ K: d+ e
The staff must be able to:3 W' N1 B7 ]2 [3 h2 m) h. v+ P- V
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
% m6 _, V7 q8 o" F1. 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.
7 V) E4 p! [# }, n: A+ L* E The interface should provide a menu so that the staff can:
6 |' o& i6 o" y& m( a2 S; xa) Enter the names of the two Java program files to be compared
2 h+ L; h8 ]- S For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: d/ ?8 L, J/ }& G- j2 E
** 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).$ e2 H9 T5 N1 G4 p: g! ?# a
BSA104 Business Programming – 2007: Assignment 2
& Y" Y6 U3 f0 A. O" m# x" X, ?Page 2 of 54 }, N# S; V" g+ d+ A
b) Print out to the screen all the lines of code that are the same" O2 `2 }- O, R" T7 F, A
 Include the name of the file and the line number of the code being printed for each of the two files
) B8 F. A, X( ~3 D z; ]! bc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
" b& R, g7 M$ p) n/ V the name, username and department of the user
- H# w5 n8 e' G! n1 G! ~ the statistics of the comparison
) r; V& F3 [; l, O8 {$ t9 o4 a- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ I/ w, M" C T9 _, Q) \8 e the recommendation for further checking- s6 M% [0 f- d4 m% J. V
- 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 closely X L' I! W( S( g
 the names of the two files compared
: W% p9 f) h/ Y+ o. u) Hd) Leave the program (exit)
% k0 {6 I- P8 V. K1 ~8 m7 RThe ProgramCompare class: (Total maximum 20 marks available)
5 |! C \" ~% s' ~$ Y6 H8 f( G$ X Q2. 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): a5 o2 o* K3 D1 \: ~1 }" o4 Q1 m
a) provide an error message if the files are not found or there is a problem opening them! h4 O L* j7 d$ ^4 ]
b) compare each line of code
" T9 q- H6 K0 N# s+ y% ]4 j; x) yc) print out the lines that are the same
. [2 N! V; r3 }d) count the number of lines compared / lines the same% ~0 x U. @4 M& h" E. ]
The AuthorisedUsers class: (Total maximum 20 marks available)
& }, T0 [) O" W% n- x3. 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)- o7 w }* E& w1 W2 [
4. Provide methods to:
2 T+ I+ r- S7 @* xa) 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% h$ \2 d% ?% W
b) return the name of the authorised user
: I0 W- S0 H! J* ^ o, Rc) return the name of the department of the authorised user
1 f- E* x) y; ~3 iIndividual Data (Maximum 20 marks available)6 x: @( D9 K; X! L8 G# c- p
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.
# F* W( R5 s" C" {6 A* UDocumentation (Maximum 10 marks available)
+ S5 h: f3 I0 A: Z* ], n9 c6. 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.5 L" T, z1 j- r1 U
BSA104 Business Programming – 2007: Assignment 2
0 d# F1 Y2 z' O; q/ d8 t: PPage 3 of 5 |
|