|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming9 C# U }# ^ l8 d! }1 j
Shanghai - 2007- i& }+ N2 Y5 E- i
Assignment 2
8 Y2 I- V% w" B. iDeadline 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)* `: }3 h- F- o9 u0 j
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 P4 h, _+ A4 x3 [The staff must be able to:
/ K$ e, M& X- }! k0 G8 Y# _6 l Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
. `: }% K& ^% k( ?" H6 |5 ` _' c1. 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.
9 Y6 P7 A* X' G The interface should provide a menu so that the staff can:
* ^& Q$ G$ i3 N7 ` ja) Enter the names of the two Java program files to be compared: [ { \; b8 t6 X6 ], l
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
$ ^# ~7 `9 `# {# M. }** 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).
4 V# l1 ?2 D/ Q( @+ f% jBSA104 Business Programming – 2007: Assignment 2
7 c- R' u* K( ~& J+ ]/ M( rPage 2 of 5$ E* s/ C, N) k) J
b) Print out to the screen all the lines of code that are the same! k& U( {9 E' E/ C7 U/ w
 Include the name of the file and the line number of the code being printed for each of the two files; C, Y; X- L+ E/ s
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 B* n; }- p' V5 x* M+ g the name, username and department of the user
* f) t) L3 X J# P( U9 p3 J1 B5 e the statistics of the comparison" \8 Y+ f' j. N/ p% T9 r
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
( x' M+ b& c% ~" a the recommendation for further checking
% f; W- A# _7 g$ n& E- 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" \: c% P" A% |: D
 the names of the two files compared* E/ w8 I7 O3 O( W1 b% H
d) Leave the program (exit)' z( q) O* I7 K% N6 X
The ProgramCompare class: (Total maximum 20 marks available)5 O! s; D7 R7 _) C1 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); k2 L/ ~1 N9 i* D" ~% e" L
a) provide an error message if the files are not found or there is a problem opening them2 L5 Q9 j* L C6 p2 c4 b. }. K
b) compare each line of code9 x" y6 T6 k: m1 d$ v; u
c) print out the lines that are the same
; v, a0 A. W8 c& Yd) count the number of lines compared / lines the same
8 n3 L7 B- \( s& z& C. L. Q2 r" f4 aThe AuthorisedUsers class: (Total maximum 20 marks available)
+ g9 m/ Q3 M0 @# }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) s5 p% o* Q9 M8 g
4. Provide methods to:
% L2 n# s; a" x- o e. E' Ha) 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
- A( x6 C% r2 F; O/ y" vb) return the name of the authorised user: F# n- u0 r0 z1 P& b" N+ D
c) return the name of the department of the authorised user
4 t: W5 i# B" s: `# LIndividual Data (Maximum 20 marks available)$ H$ N! h- n6 u3 v
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# P; q% C: ]: |; X% d+ I
Documentation (Maximum 10 marks available)! J/ B( \+ H* E0 _' w$ A4 E: K
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.
& I4 Y/ W. |1 n8 y2 C3 [BSA104 Business Programming – 2007: Assignment 2" f: Z' l5 x: ?+ o L3 y
Page 3 of 5 |
|