|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
7 d6 X% U8 |* C$ vShanghai - 2007
7 U: J f n/ n$ t1 u$ a+ Z7 fAssignment 2
- s/ ^! l1 |6 w; YDeadline 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)2 n0 X- V) S% P0 D1 u2 v1 g: e
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.5 ~5 ? ^& d: o) t' \8 D! ~/ O
The staff must be able to:/ d; i7 I1 U# X" K' z
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **." I* Z: v! K# J$ ]1 N. y3 M
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.+ n$ L2 Q7 Q# o
 The interface should provide a menu so that the staff can:2 c# l& c& T4 a: Y" Z' H5 e' f/ N
a) Enter the names of the two Java program files to be compared3 k+ ^' {5 Z6 Q9 I- s
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
4 V2 f8 u7 C7 j! `** 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).8 [* ^9 R- `! H% a |
BSA104 Business Programming – 2007: Assignment 2
6 O9 A/ V" c6 \& nPage 2 of 5
( W4 l( U, K1 ?# f9 pb) Print out to the screen all the lines of code that are the same
% E* |# ]7 Z, R) D9 c Include the name of the file and the line number of the code being printed for each of the two files3 N# @' w- G9 _" ^5 i0 \
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
[" O% x" t) u! Y; q( F the name, username and department of the user
* p5 y& Q& b( C0 Y( y the statistics of the comparison
' f. x) j4 |+ [+ d- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 \7 ]6 y* n# z( X the recommendation for further checking
7 k k/ p7 P, r, q7 M% }1 f- 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
% E' U7 D5 e4 d9 d: N }) h8 R the names of the two files compared: `& p* U. i; ?3 X9 v
d) Leave the program (exit)
) L* w6 ^2 l$ \, zThe ProgramCompare class: (Total maximum 20 marks available)
, y, S; k8 y7 e( e' g2. 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)
6 G: ]3 X; l8 G0 Z- A6 m6 wa) provide an error message if the files are not found or there is a problem opening them
8 |4 N2 _2 s, y" `# hb) compare each line of code
1 ]; h) w% c8 y: C/ T# Y, f& Oc) print out the lines that are the same
0 s8 P) ^5 A: S$ ]7 g" p: y9 Td) count the number of lines compared / lines the same/ g% F5 R" | J$ r' N
The AuthorisedUsers class: (Total maximum 20 marks available)- \+ P( X$ e! {) e* Q
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)# ?9 B+ Y# V B, T
4. Provide methods to:
5 ?# z5 z' u% ?/ x* ^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( N5 f; x& |& e1 Y: A% q5 Q; i- m
b) return the name of the authorised user$ }/ t+ G7 Y8 ^0 \
c) return the name of the department of the authorised user, \ x0 ~" @% i) ]8 ^! L( S$ r
Individual Data (Maximum 20 marks available)0 {, y+ m. r$ e3 K, m7 @, G
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.; ^4 f7 P, Z9 I/ N) ~/ {# V
Documentation (Maximum 10 marks available)' S5 h' o' ]$ p' Y3 ? 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.
K; d+ s- Y/ j, K# S6 ?BSA104 Business Programming – 2007: Assignment 24 H# @3 S4 m( R0 M
Page 3 of 5 |
|