|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
( J: Z5 [& q! y6 L2 xShanghai - 2007
( V6 ]& V8 p+ Y6 k1 A$ g( r% OAssignment 2
& E" \# |) E m, \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)
/ Z7 t' Z& |! k1 }& S6 V1. 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.
' L) T4 T4 a l7 \2 ZThe staff must be able to: z5 G: o% V- \% N/ q6 z3 M ]
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! X# C8 v8 Q/ k8 U
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.9 [3 W% x9 b+ S3 Y8 u/ i$ E
 The interface should provide a menu so that the staff can:
0 w4 U3 }$ p$ `8 y4 C3 @4 m9 R4 Ma) Enter the names of the two Java program files to be compared' ^, f; G, Z( J
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: ^( p/ @& e4 W/ ~* Q R' ?
** 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).# R0 m/ `& W9 x( M, @; G% B
BSA104 Business Programming – 2007: Assignment 2 Z7 k! s3 X4 t- h
Page 2 of 5
& l1 w/ g- y$ hb) Print out to the screen all the lines of code that are the same9 P) |2 A9 g" L, E
 Include the name of the file and the line number of the code being printed for each of the two files% N4 S+ S' y( n3 e! d- O1 l
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
+ P6 E6 Y( ?. u" {8 a$ l( W5 n the name, username and department of the user; G3 x( I, Z, t- A& V
 the statistics of the comparison
* ~6 j9 f$ E1 E- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different, ?9 N! t: H7 D- F
 the recommendation for further checking, v8 `1 E! j$ Z( F) n2 n
- 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- M( B# A& w/ F. I6 s4 R3 Y7 B
 the names of the two files compared
; `( r- I& P+ r8 Cd) Leave the program (exit)2 o, h8 g6 R* b8 t# V( K1 D. M
The ProgramCompare class: (Total maximum 20 marks available)
) S: v6 i" v) S: k2. 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)) c0 g+ ^0 F k' v
a) provide an error message if the files are not found or there is a problem opening them1 c. \" }4 c, J) y4 j- c
b) compare each line of code5 W7 Y) q0 K5 [5 y& P
c) print out the lines that are the same9 M+ f0 g! _0 {
d) count the number of lines compared / lines the same
# r- G, L) _7 F+ x0 g. H4 W) n( U" OThe AuthorisedUsers class: (Total maximum 20 marks available)
( W, h6 B, U L, `# b6 y3. 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)
" B K' ~, g. V7 B4. Provide methods to:, u4 v: Z6 k5 u9 o' ?) g& p
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 match9 F: n" H5 F( Y# ^5 P# J0 o2 I
b) return the name of the authorised user
$ Z7 Z+ Z& ~9 w" Z* `; b" ec) return the name of the department of the authorised user3 @# L; o9 p" Y+ p
Individual Data (Maximum 20 marks available)$ ?, L" V7 o( r# y
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.
0 ~# D( [8 U/ A/ j; T: I: wDocumentation (Maximum 10 marks available). k+ `% }/ {7 a- H9 g
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.
^. J# i$ m- Y0 m( x# m: zBSA104 Business Programming – 2007: Assignment 2! o' {# ~& B: a6 Z, ^0 o+ v
Page 3 of 5 |
|