|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming3 |( Y0 }3 ?# U3 g' O
Shanghai - 2007
# v# e+ s; B; |Assignment 2
/ T6 F, z+ W5 U( T& o- ?0 q( UDeadline 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). r$ i! c) V& [7 e9 n8 a
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." }& l& D- g( m0 i8 _) W3 e
The staff must be able to:; l; }( }. i$ [8 T8 ?5 e
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.- E, b+ e9 l2 X! W3 G+ a
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.
' t+ r: K6 L% L" z3 J! a7 o The interface should provide a menu so that the staff can:
4 c' Z# u- r1 Q* _) N. `; pa) Enter the names of the two Java program files to be compared$ Q% Z' F3 j4 d
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
) {( X; d8 b' M, B' _) ^** 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 O1 | P4 S: y% @% cBSA104 Business Programming – 2007: Assignment 2
2 P9 E( y3 {3 @# t, Q7 K: H2 QPage 2 of 56 O F, f p6 j6 m
b) Print out to the screen all the lines of code that are the same7 A" B7 y5 w5 B1 t u+ I, n) Q( h
 Include the name of the file and the line number of the code being printed for each of the two files
8 n/ Z+ S3 y( F# B- M# ?6 dc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared ~5 J" f# j- k! ~% H
 the name, username and department of the user2 u( m9 T2 q, ~/ k
 the statistics of the comparison& i4 M7 t4 ~4 U5 B4 u$ j) p x
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
; C; }( I+ j7 U- l9 } the recommendation for further checking
, M' f4 ?$ V" ~2 e) g) ^- 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+ `& A$ h+ |1 e6 C' M
 the names of the two files compared
) d6 P; j* P5 e5 s: f2 Md) Leave the program (exit)
. G% C; `7 a8 P9 d1 s. RThe ProgramCompare class: (Total maximum 20 marks available)
2 h' u) e9 @. E) z- w' 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)
* H$ v0 S( _; K9 w; x5 Va) provide an error message if the files are not found or there is a problem opening them
" z3 c- y" a1 G( p8 {b) compare each line of code
' U) R, o$ q+ J. z oc) print out the lines that are the same, l% s9 B1 i8 X" r6 ]
d) count the number of lines compared / lines the same
' x0 X, }' E9 y% bThe AuthorisedUsers class: (Total maximum 20 marks available)4 R/ o8 R/ h* P
3. 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)
; E7 v& t) O& F! `3 }: e4. Provide methods to:8 f/ z! P: }& ^5 c0 B4 B
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 X3 F* f q6 X% r! g7 y$ l0 g, u
b) return the name of the authorised user
x! L- u- o6 Z8 c' c7 Vc) return the name of the department of the authorised user
6 ]( W1 B8 K# \- yIndividual Data (Maximum 20 marks available)
" n& p @8 A, a8 o* M+ s5 z6 |9 ^+ K5. 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 u1 K3 e( `6 L" v& ~Documentation (Maximum 10 marks available) H4 |4 k: {4 y. ?
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./ A2 {9 Y$ q+ d, V3 B L. w* H
BSA104 Business Programming – 2007: Assignment 2
6 N0 m* r: v" }- w# YPage 3 of 5 |
|