|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
, K3 F/ z7 ~: x8 ]5 } [) j" F qShanghai - 2007
( E7 f& f6 |' f' b2 F% n. p* O3 @: UAssignment 26 \- s6 A' I7 L7 r/ i2 V0 @$ L: @* s
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)
3 c. X, }3 O3 U* H3 P+ I4 U# t1. 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.
" d& k' g7 {. `; w3 J, b8 q! |' ZThe staff must be able to:+ y Y5 u& z e) d- J6 d) E8 _
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.. X) z/ _7 S1 f9 K$ d
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.: d8 s* E/ S0 i# ^- G5 I. d7 N: b
 The interface should provide a menu so that the staff can:- ~; t; f) R# J4 y% w& O
a) Enter the names of the two Java program files to be compared
+ O3 S- u, `+ i# Z3 R, n. K For this assignment, it will be assumed that the two Java program files are in the same folder as your program.7 \9 D! U. l5 ]' }+ L; 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).
9 Y, e+ d( I! \! c+ S0 WBSA104 Business Programming – 2007: Assignment 2. N* h- }8 K7 r2 n
Page 2 of 5
) @$ \8 n& j, Q+ ~0 vb) Print out to the screen all the lines of code that are the same+ E; w1 k$ Q: T
 Include the name of the file and the line number of the code being printed for each of the two files
/ @$ ^; H3 B2 Z4 P7 \# y( [c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared/ z1 J, n& J0 i0 ]% p
 the name, username and department of the user
) e0 _6 s# _/ S0 k the statistics of the comparison
# a: q( w3 k% I3 |( i( L- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
3 B, s: J; X# l$ F+ Q the recommendation for further checking: Y: |) V% l: y( H* A, w$ ]
- 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
( l- @2 N% D" W8 X6 ~% w! [- |/ J the names of the two files compared' i% k) s5 \3 o5 n% d5 m( l
d) Leave the program (exit)
0 E' M0 X- l5 }The ProgramCompare class: (Total maximum 20 marks available)
5 W& D4 Z/ J6 _, I2. 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)
* m: ~7 j8 P! H6 }7 fa) provide an error message if the files are not found or there is a problem opening them' X0 x, n+ o9 N+ d$ F
b) compare each line of code
- }+ ~3 @, E q: O* g' D. \" _7 y+ Oc) print out the lines that are the same$ a- s8 `: ^1 g( \6 @' x. Y
d) count the number of lines compared / lines the same
4 B- ] @- a/ _: a: jThe AuthorisedUsers class: (Total maximum 20 marks available)
( ~" I( E" }/ r/ W* |4 I3. 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)5 T% O# e$ i8 Y! G2 p& H( @
4. Provide methods to:
O/ _5 y0 x# [4 P5 p& r; ya) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match3 y3 R0 T/ H( ]; j: g) J9 L
b) return the name of the authorised user8 D1 d) @( W$ \% B
c) return the name of the department of the authorised user
8 H, t+ Q. W, y4 }2 O$ p) {Individual Data (Maximum 20 marks available)
/ C; W5 w6 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.
: j! S1 |9 q2 E' _: ]Documentation (Maximum 10 marks available)
4 m* a' U3 K- r k0 I/ a6. 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.
7 g& T: _; K7 W7 d- P( f' kBSA104 Business Programming – 2007: Assignment 2
: L% o6 q" R7 n7 C7 g( ~Page 3 of 5 |
|