|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: t8 ^9 `, [* i' `8 a
Shanghai - 2007* w" x7 k8 [2 c! \
Assignment 2
- \2 u, M- t; |0 x- W k: {. k3 Z* n' S( LDeadline 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) |7 i& ? B5 g) @
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.- Q* W- e8 x1 R7 o$ l1 w# c+ {
The staff must be able to:
1 B( |5 ]. {; w. }) D7 j! p Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.) m* E7 I3 e, P, Y6 W' v( Z
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.) y" y1 z) S: y1 U8 q4 @
 The interface should provide a menu so that the staff can:3 R0 C5 R9 a z% `
a) Enter the names of the two Java program files to be compared
# T1 @8 U, t: M1 t X0 N For this assignment, it will be assumed that the two Java program files are in the same folder as your program./ c' |, R d! R6 W& d4 E5 t
** 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).
2 G, P9 i; L- v6 v( CBSA104 Business Programming – 2007: Assignment 2
4 N) g {+ r! y/ b# j: Y3 G7 ~Page 2 of 5
# h+ S4 M, h4 x0 pb) Print out to the screen all the lines of code that are the same
4 {1 f) [2 ~( n( P. o- r Include the name of the file and the line number of the code being printed for each of the two files
1 a' d2 d" B; \/ m/ k3 N0 r. `2 s: dc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared/ g, ?, i( L G- n
 the name, username and department of the user8 R0 s# [% [# q4 R
 the statistics of the comparison) }' z& Q3 P0 }/ I( q$ b6 F. {
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
% E5 T! Z& Z7 L the recommendation for further checking9 N a/ s9 C: V7 H& 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/ f; D) Q7 Q% l! H1 R- l. J5 t
 the names of the two files compared" \" |, e/ u3 _! l0 w
d) Leave the program (exit)
( _- r2 x+ g% J+ n" m. ?2 A' _The ProgramCompare class: (Total maximum 20 marks available)7 z3 d/ H% u; u9 t" b
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)
4 e2 ?( V0 ~& p9 m$ }% a, o* |a) provide an error message if the files are not found or there is a problem opening them
0 U: d" H3 _3 C$ h& f% Nb) compare each line of code# u4 O5 `6 k' `9 B6 H- w+ T
c) print out the lines that are the same) X4 p( S1 _: w# F5 ]
d) count the number of lines compared / lines the same6 `4 {. O9 W* q: I$ c# T( a
The AuthorisedUsers class: (Total maximum 20 marks available)
5 l. J, w: ~7 ~1 l9 h8 B; h( T3. 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)+ W; G7 J; K$ g0 N4 Y9 Z* `# P
4. Provide methods to:% m" C6 \% e ^6 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 match
( ]) Z( r$ X) {0 S# V: t( mb) return the name of the authorised user
' a; w+ a. @7 \' Pc) return the name of the department of the authorised user. ]4 e( o* ^: W5 w: U- z0 O
Individual Data (Maximum 20 marks available)1 u$ {, d3 E- F
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.( E# f4 @: Z) ^
Documentation (Maximum 10 marks available)
- M( I. O, v3 T2 I+ t6. 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.
. V4 ?8 C. a* t: _/ l! m2 y3 ABSA104 Business Programming – 2007: Assignment 2
- x* T1 ?6 z4 i; QPage 3 of 5 |
|