|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
8 R R: D1 s8 q+ q( C: \7 D: DShanghai - 2007 l+ N/ k1 U2 V
Assignment 2
/ F! c) X3 Q% [: d! ]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 C% Z2 N1 x, S5 r) Y7 A1. 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$ S: Z# y! ~
The staff must be able to:
# f* y R5 ?7 L3 x) g, W. { Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.) N8 G. y V# P8 l2 ~* d" B8 r- n5 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.* F* O* r5 w9 o% z1 n" K4 G# `
 The interface should provide a menu so that the staff can:
+ \ ?$ c* |. b$ W5 L& ta) Enter the names of the two Java program files to be compared
6 x( I3 ?8 S9 y For this assignment, it will be assumed that the two Java program files are in the same folder as your program.3 I3 L# E" S( ] d7 I% {
** 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).
/ l- f0 L' s6 r; `7 x- JBSA104 Business Programming – 2007: Assignment 2
$ b5 g/ l% f3 X# F; B( x3 vPage 2 of 5
* }' j8 ?- U9 d) p5 tb) Print out to the screen all the lines of code that are the same! N4 x2 V' d" [& `, K) e* z, U% t- x
 Include the name of the file and the line number of the code being printed for each of the two files
. l# {. _- t2 ~c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
+ C# ^. D& d5 c- u ` the name, username and department of the user f; d$ z7 r, q3 n1 v" E
 the statistics of the comparison3 W9 F1 u3 R; y/ v1 x" ?7 A
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
5 @. } \1 ]0 R" b, z the recommendation for further checking- {6 O8 j7 |3 y1 C8 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 l/ v* a" t- |' j$ N: V6 v3 s9 T
 the names of the two files compared0 a3 f% }; z4 U4 V- w5 t
d) Leave the program (exit)! B( D! A- i; {0 @$ \
The ProgramCompare class: (Total maximum 20 marks available)
! k# A T- C: C/ J0 J: E5 b2. 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) W1 |( Q9 `9 g4 A
a) provide an error message if the files are not found or there is a problem opening them
% b) J4 T5 j& fb) compare each line of code3 u: N; D2 g0 m/ _! ~* U# P2 B! B# e
c) print out the lines that are the same8 Z. \2 D$ ]! f' j8 q& k
d) count the number of lines compared / lines the same
& Q. G' a0 u3 b1 q, j) O% rThe AuthorisedUsers class: (Total maximum 20 marks available)
L2 z n$ D: a% 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)' E0 W7 ]: L/ i- `; y7 m( d
4. Provide methods to:/ {$ w) `5 A% t' g
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
6 X9 u+ ]: |2 o5 M6 c8 }b) return the name of the authorised user
( z% z2 y( T" G! m( y4 | vc) return the name of the department of the authorised user
8 A! }9 z& m: F' B WIndividual Data (Maximum 20 marks available)6 F; P/ w* V. e% M. i
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.5 J2 D) E9 R% ^& [) t; H5 b
Documentation (Maximum 10 marks available) z. [: ` G7 A
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. i# G; x7 g, v4 ^# K7 Q
BSA104 Business Programming – 2007: Assignment 2
4 K- w# U& J/ _/ i# A' }% IPage 3 of 5 |
|