|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
8 l- H0 B# a1 uShanghai - 2007/ T9 }6 c3 }+ U2 Y0 j8 w
Assignment 2' e! G- s: o7 t, G) }. k
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)
& S- ~- H( P. ] _2 }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" z, w& ]
The staff must be able to:5 {# B m* L T0 ?5 ^
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **. R: q* z8 T! [) t1 P5 l* @& E& d
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.; w, n4 D0 M& \1 N! B
 The interface should provide a menu so that the staff can:
: p, N0 H p! z3 D' K3 W; c2 Ha) Enter the names of the two Java program files to be compared
8 u+ J. U8 V# U* `: \4 i% [ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.. r8 ]' ?5 R) |2 P0 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)., ~ z, q4 r7 j3 ]
BSA104 Business Programming – 2007: Assignment 25 ]1 n4 S5 e7 } y% s
Page 2 of 5% ~( |0 [1 j0 `5 i( t9 ~ m. x
b) Print out to the screen all the lines of code that are the same
3 ^: D8 [, d% U: L5 G Include the name of the file and the line number of the code being printed for each of the two files
' C9 ^- y9 U" Q; Rc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
! F& w+ S8 v4 ~; Z the name, username and department of the user4 J' l w/ G% I3 x
 the statistics of the comparison. F( B: \6 h8 Q9 k) I
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different) W8 C: q3 E: H; r# s
 the recommendation for further checking+ J# a* B: L3 {7 U$ k1 v9 B$ P
- 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) g% [- B4 k; v" i V; P! N* D% T
 the names of the two files compared0 l2 [( t& }' X6 n/ t
d) Leave the program (exit)8 ?; R" p8 V/ L& x$ s) ^
The ProgramCompare class: (Total maximum 20 marks available)
+ \- [* J2 M( \. S ~. L) ~- ]( Y2. 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)
2 V* O- G. X# `, O8 C/ ia) provide an error message if the files are not found or there is a problem opening them
* M+ p! ?+ \- {/ nb) compare each line of code) U" I9 o9 j% C. z3 p2 q1 D! N7 }! t
c) print out the lines that are the same: c! y0 A% i$ k2 E" Y% F: w1 P
d) count the number of lines compared / lines the same
7 `- N0 K6 E+ r7 o BThe AuthorisedUsers class: (Total maximum 20 marks available)
+ q" U* T: g4 j( Z2 M1 p6 ]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)& i0 r& J1 P& t) p* H0 s8 u
4. Provide methods to:6 A f. U3 ?1 F0 h6 E
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 match4 T) F4 q7 u! M( P
b) return the name of the authorised user
& I& ?* a0 I; wc) return the name of the department of the authorised user
9 Z) K2 I1 W4 E8 n! BIndividual Data (Maximum 20 marks available)
9 h5 F! t3 r* w0 F/ j4 D4 s+ ]2 [4 h5. 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.
! K$ f6 d: G6 e; ?5 p9 i- pDocumentation (Maximum 10 marks available)* O- n9 ]2 m- H; R7 B. Z1 b
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) h' a. }7 ?1 z! i9 TBSA104 Business Programming – 2007: Assignment 23 v8 K- n9 Q( L& g
Page 3 of 5 |
|