|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
% k- x2 _; x0 P( ], TShanghai - 2007$ z2 e. N! z7 Q N; ?
Assignment 20 a4 ~/ }6 E# G
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)
2 a Y. P2 @/ C; Y H# X- i# h, e1. 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., B- T, L5 G) A0 I# {( I
The staff must be able to:
7 @" y& e9 @; d5 P. P Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
3 |5 z2 g$ t2 K, z/ Q1. 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.
& u2 v4 K' d# j& I/ C: s6 S The interface should provide a menu so that the staff can:
0 g5 W! n6 ^/ p6 Za) Enter the names of the two Java program files to be compared* a" K/ D2 D5 Y0 R# }' l: u" F
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
/ x/ J9 c g% K** 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).
# y2 Q' F$ U0 qBSA104 Business Programming – 2007: Assignment 2
7 P' e' z" D. `- E, zPage 2 of 5
& b- s+ ?0 _6 T0 jb) Print out to the screen all the lines of code that are the same1 a6 J u8 g7 X: E
 Include the name of the file and the line number of the code being printed for each of the two files3 r4 d3 {3 }) H7 E
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared# c, G$ `1 D0 Z O, i
 the name, username and department of the user
( K: u" B1 \4 s the statistics of the comparison
! @3 M I) Z9 n w- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different" r' e0 k- p; B- x4 p2 W" ^
 the recommendation for further checking l) F( I4 w7 Q+ n V0 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 closely4 z" {- V5 \6 f1 P( m/ B
 the names of the two files compared% ?4 Z9 c+ \. o" {" `
d) Leave the program (exit). l0 v \% |* p9 ^
The ProgramCompare class: (Total maximum 20 marks available)/ p1 {, ^2 _3 U( ]# r N
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) B9 k- u: ?- A m" I ~( G) B% E
a) provide an error message if the files are not found or there is a problem opening them
( f7 ^( g0 A, nb) compare each line of code0 L% S+ z6 x; z1 @! P' S
c) print out the lines that are the same O3 f* ?+ x" w* ~ D/ ^4 Y" f6 [
d) count the number of lines compared / lines the same9 i8 ]5 J x. j/ ~6 K/ [. N" l% S J
The AuthorisedUsers class: (Total maximum 20 marks available)- k& w, z) B5 u: u/ d
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): d9 {2 M) ` Y2 x) r7 u2 C
4. Provide methods to:! c" r& Y/ k, f# _
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 match8 s) j7 u- ^. a2 \6 [0 j1 |" E
b) return the name of the authorised user
' F/ o* ?- y$ Q8 H5 S8 ]c) return the name of the department of the authorised user. q7 C' W' r1 v( Q
Individual Data (Maximum 20 marks available)# D) R' r7 o4 I% Z" 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.5 M- ^7 b; `* n4 l% i/ y
Documentation (Maximum 10 marks available)
& O" ~) B. j9 n, g2 l6. 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.
& h* p, g% { M+ Z# k% J/ u$ tBSA104 Business Programming – 2007: Assignment 2
2 H/ h; o' n0 g' E0 P3 H" sPage 3 of 5 |
|