|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
' d* I2 k* O4 A8 {Shanghai - 2007$ [+ `! O) i# R
Assignment 23 p# ]4 y7 J2 i, r5 {" U9 c7 E8 i
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)
9 Y0 e/ s+ [: v+ i. f$ m- 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.
- K" x8 s; {% u# i1 e. BThe staff must be able to:: f% f$ J. O! K# F" T+ G& E
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
4 k$ I7 e9 n6 p1. 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.0 X8 w9 Y2 u/ s* J0 W
 The interface should provide a menu so that the staff can:
5 z* c, I* Y+ H& ]2 m9 P0 @5 w+ Fa) Enter the names of the two Java program files to be compared
' Q4 u( w2 R2 c3 j4 Z2 f& r For this assignment, it will be assumed that the two Java program files are in the same folder as your program.- k% U* h8 B+ G5 r0 ?
** 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).% `+ q3 P$ o& \. s; t5 @3 J2 [
BSA104 Business Programming – 2007: Assignment 2& f8 ^8 e; P8 p( N$ i) r3 Q z: m
Page 2 of 5
- b9 e" `8 |. lb) Print out to the screen all the lines of code that are the same
, ~2 f6 y. Q5 K" p, J7 u6 @+ @* v- R Include the name of the file and the line number of the code being printed for each of the two files7 p2 Z3 G) E8 U3 _: Q) j" q
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
) ?9 l, ]4 B$ n the name, username and department of the user2 b1 I5 a* ^! K1 S
 the statistics of the comparison
' p" f' T3 i2 O; B7 f8 R- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different" a3 s7 |3 w# F& k
 the recommendation for further checking
/ v* c7 j. v/ K+ 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
( ~* @2 F2 J1 o8 K2 z the names of the two files compared9 B3 K, @) H+ I. i" v
d) Leave the program (exit)
& p M0 y) Y, R; rThe ProgramCompare class: (Total maximum 20 marks available)
1 u1 o% J4 z: L3 |$ w, G% C2. 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)
* J- j {. }' F' Sa) provide an error message if the files are not found or there is a problem opening them
+ d: k% U3 D+ _; x1 }, a3 @b) compare each line of code- l8 c. w9 N8 K6 o8 F8 h
c) print out the lines that are the same
0 T: F- k( H+ p- g j/ hd) count the number of lines compared / lines the same( N. m2 ?- Z1 |, S$ k
The AuthorisedUsers class: (Total maximum 20 marks available)1 z! y! d( g% n Q3 k, b
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)
# ~8 d2 \' ?2 m" n) U# C# V4. Provide methods to:
3 z( ^8 n) d! ?+ }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
: d$ n! U3 j! r8 K! ]b) return the name of the authorised user, [$ X4 _$ l) j- ^' Z* q
c) return the name of the department of the authorised user
4 a) s; d( J7 X% G3 {: p" YIndividual Data (Maximum 20 marks available)
9 n+ m3 I! t4 j2 f5. 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.
0 M% {, R S6 hDocumentation (Maximum 10 marks available): E* |+ w2 h5 z' V1 y8 R8 P @
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.
# O4 g s$ z% r9 K! z& RBSA104 Business Programming – 2007: Assignment 2% i+ q% B- Q% W
Page 3 of 5 |
|