|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming4 v8 D1 b3 ^; L( r4 s' `
Shanghai - 2007
) v; B( O: e l/ C [, Z* T3 _Assignment 2
3 J+ t; n9 [* \5 e! Y- j7 l& x) X4 DDeadline 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)/ J( a- l/ D8 W ^; H' N* 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.- Y z+ b8 `# ^
The staff must be able to:
9 K5 V! C' T$ o3 ^! z! \ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.- Q9 _$ D4 X- S* \
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.4 @* h" A t/ o4 R
 The interface should provide a menu so that the staff can:! S5 c0 A$ ?) ~( J2 O8 \/ B
a) Enter the names of the two Java program files to be compared
9 h; W$ J& Z4 u" {7 s' ` For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
" l8 p' a* k w$ x; t2 Q2 K* o** 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)./ a: n, ^0 e" {, b1 g# q
BSA104 Business Programming – 2007: Assignment 27 C3 u4 X% j- B2 N9 n( r1 T
Page 2 of 5
/ k+ D. j5 J4 u- K3 V8 tb) Print out to the screen all the lines of code that are the same# T! G2 Y/ y0 M6 R! X5 _5 ~0 I
 Include the name of the file and the line number of the code being printed for each of the two files
( d% R2 h- Y' ]+ s& _2 |c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
7 s3 q2 h% e8 U a* a the name, username and department of the user
& `6 r J' S3 S1 U" d the statistics of the comparison
) d- M( H U h- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different8 j, L* I* A# P" @
 the recommendation for further checking
( ~4 n+ o9 C5 `* S- 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 closely0 T8 o) y( @! ?7 i% j
 the names of the two files compared) y( M6 j7 B N; {. [
d) Leave the program (exit)3 v1 d; y, O+ d" [
The ProgramCompare class: (Total maximum 20 marks available)* @8 }, p3 P2 ]7 k1 J" X
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)
/ R9 G P" J; t& ]6 b8 w2 Ka) provide an error message if the files are not found or there is a problem opening them
; f7 [ x2 t& c' Tb) compare each line of code
2 D% o: a% x$ v k1 v6 Mc) print out the lines that are the same% w0 h1 _4 N& v
d) count the number of lines compared / lines the same
. E& V3 r- q# ?: b5 x! DThe AuthorisedUsers class: (Total maximum 20 marks available)
" ?9 k3 N3 P) Q0 e3. 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)
( A6 d1 Z7 R+ x, Q1 v4. Provide methods to:
$ o! g8 u( Z8 l( la) 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
& Q! ]9 m e% w' v2 F( Tb) return the name of the authorised user/ _ O- ]# w. n7 n, }8 x
c) return the name of the department of the authorised user1 |/ J* T0 A# }* a3 ]/ ^8 o
Individual Data (Maximum 20 marks available)
# f2 t0 i8 l% f: N5. 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.
& S. U' F, ^0 J( J- l& C2 A& WDocumentation (Maximum 10 marks available)# h, u0 c& H) ~6 a" r+ W
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.6 y- K+ X# R- Z1 l. A
BSA104 Business Programming – 2007: Assignment 2. R+ t/ s- b. E& [( |4 E6 w( P D d
Page 3 of 5 |
|