|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming7 Z( x5 R9 G" N6 Z( |
Shanghai - 2007
0 m9 R, ^$ Q& v* K* iAssignment 2# s# M5 O! [0 W, t1 p$ d/ z& L
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)
6 ~" T4 `5 J3 r3 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.% `" u6 g7 N# n& d( n% L; w6 z" c& c
The staff must be able to:9 C9 o# ^: r1 g8 M, ?& l
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.0 y2 k& |8 V8 H0 N9 D2 ]
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.
8 F( T: ]- I v, ^ R The interface should provide a menu so that the staff can:
; w+ r8 I3 [, g" ia) Enter the names of the two Java program files to be compared& V9 o! W& i$ h0 J: H' u& ^3 T* ?9 N
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 R2 p+ g( f) k6 h( Z# ]** 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).
$ u8 O$ d: u! Z# K5 \BSA104 Business Programming – 2007: Assignment 2
/ H+ t7 \2 J& k$ P+ u# B0 U) \Page 2 of 5. U1 M- u5 S6 c3 K; }3 y8 n, L1 z+ p. x0 P
b) Print out to the screen all the lines of code that are the same' f7 ]3 e* D9 _$ w! Z
 Include the name of the file and the line number of the code being printed for each of the two files
& t5 X, X& c3 Q3 jc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared" ]! P: t4 V& `, e# y
 the name, username and department of the user
) B7 m4 s& r6 I8 W) Q* o the statistics of the comparison
( ~. S: v4 J% F1 Q1 }; s- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
5 R0 x) f# i- d8 |3 T/ [4 V the recommendation for further checking
8 A2 {( q& G6 L- 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
, R8 h- [3 Y9 i6 y# V% A; b5 { the names of the two files compared
6 |' k" R' [. y3 ud) Leave the program (exit)
" X% F- I. D9 ?7 ]( ^: R" NThe ProgramCompare class: (Total maximum 20 marks available)/ u9 h: B, H4 m+ b- d+ e
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)
1 r& u, \; \8 L$ Y3 ca) provide an error message if the files are not found or there is a problem opening them7 e6 ]) x3 p# Y* X5 y
b) compare each line of code9 s$ {! q, V9 s' ?7 V' \
c) print out the lines that are the same: T6 H* b, U* ~. G( m1 j0 X s
d) count the number of lines compared / lines the same
0 m8 h; m- [6 l* c; t- qThe AuthorisedUsers class: (Total maximum 20 marks available)
7 ]8 U5 n# e# d, z( _, M! b3. 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)# a( K+ m: n, K( ^" S. p
4. Provide methods to:" r2 `, y& z4 ?+ ^
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
8 p% t( n; a! T n' }) ub) return the name of the authorised user7 {: V# k9 G" G* P. z T
c) return the name of the department of the authorised user, a5 k- o6 t( L- b2 t2 S
Individual Data (Maximum 20 marks available)' x. Q+ i+ w. ~+ @! J9 ?2 Q4 f
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.
5 H; r/ T) N1 l! z* ?8 d7 \) pDocumentation (Maximum 10 marks available)
1 L8 f8 c, j4 Y8 ?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.: C% W5 c3 X3 L" _( Y5 N9 G
BSA104 Business Programming – 2007: Assignment 23 X. q3 @/ r) @+ }- i, e
Page 3 of 5 |
|