|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming( N9 G/ {% [5 n( @
Shanghai - 2007
8 O9 b+ E$ R% G5 G8 Q6 mAssignment 2
( }7 a, g/ x0 `$ C* vDeadline 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)
8 j5 x Q: f2 I; C% _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.% f7 F+ d n- J ]
The staff must be able to:' m6 Y- _& J, O: K/ L9 Z' R ^6 {
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.' _, h3 a2 j8 A5 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.
7 V0 R$ I* |8 {2 N2 g/ T& x& a The interface should provide a menu so that the staff can:
) f+ Q, y& A! o- G; }7 C1 t$ Sa) Enter the names of the two Java program files to be compared# e0 J3 t8 P9 i5 z
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
5 A- O* R- _' J7 p1 }3 q0 f% ~** 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).* K2 V( P! k! T' k
BSA104 Business Programming – 2007: Assignment 2
- f/ o* a. s+ e/ M/ TPage 2 of 5% O5 Y: e" H! a
b) Print out to the screen all the lines of code that are the same; t2 M) C7 g2 U" y8 X+ X" L/ f
 Include the name of the file and the line number of the code being printed for each of the two files4 K7 Y" Z9 E) v
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 N& Q8 ~! l6 f1 `
 the name, username and department of the user7 U! T: u4 Y& e' s u# ^
 the statistics of the comparison
/ M1 }8 i3 x. l8 @, m5 v% Q- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ T a; r# ?0 r8 D% l+ G
 the recommendation for further checking
: l0 s# |( g' K8 D9 P5 J2 k- 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
/ T. |5 ^3 c& n/ j) Z. h+ a the names of the two files compared( H2 w& |: ?3 r( S9 I
d) Leave the program (exit) t7 W, u, s, g" B$ c+ ~3 E
The ProgramCompare class: (Total maximum 20 marks available)4 r: R. R& m0 l& M
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)
7 h, K5 I1 b2 x. J; L+ W) E! ra) provide an error message if the files are not found or there is a problem opening them
* l0 ]6 |/ x4 E$ x8 [7 Q6 kb) compare each line of code
' R# t7 b3 S ]( Lc) print out the lines that are the same; ^$ l5 D! ?: I: H; g# P
d) count the number of lines compared / lines the same. q/ f- N- N; t Q
The AuthorisedUsers class: (Total maximum 20 marks available)+ v D P2 U& E
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)2 \# F0 V" M. f y+ K
4. Provide methods to:
& ?, m0 U; {1 r8 e( l8 t/ ka) 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& g6 @0 d* R- x' Q; D) e0 f
b) return the name of the authorised user- d9 d0 w7 I( ]9 o
c) return the name of the department of the authorised user
( [/ Y! ?* \: p" a+ JIndividual Data (Maximum 20 marks available)1 f2 \0 S' _! j
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.# h- o3 X# Y1 `
Documentation (Maximum 10 marks available)
$ J0 m3 z* K) F! d$ q6. 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.
* k" i$ F! z* Z- ]: C% S. nBSA104 Business Programming – 2007: Assignment 2% b4 _8 S/ q4 c7 a
Page 3 of 5 |
|