|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming9 \" U3 o2 B s3 f% T9 P1 {
Shanghai - 2007
( S- u( _$ h( q" b4 F0 UAssignment 25 J4 c* m y3 E/ o* d8 F$ t
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)& r8 w& m! e% C% b
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./ d' K3 l8 g: ]! x; c
The staff must be able to:
4 [8 z! w* u" R" m$ K" I8 c# T Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 Y' d- O+ h5 {: {6 o' D1. 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.+ C2 u6 D5 w4 J' K. J, O
 The interface should provide a menu so that the staff can:/ v! j( {/ |5 R0 C/ O) g; g3 s
a) Enter the names of the two Java program files to be compared' Y; s8 X* Q$ P4 Z+ M+ [( u; D
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.; M2 C; g& v+ U& 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).
: I: m; L0 n+ o0 H3 vBSA104 Business Programming – 2007: Assignment 2
6 T7 F0 t! D1 C% R. Y+ QPage 2 of 5" `( G) ^9 I6 E& u
b) Print out to the screen all the lines of code that are the same9 D6 F% W3 j; p" U# \
 Include the name of the file and the line number of the code being printed for each of the two files
2 p7 `8 @ O$ T; [c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
" ]/ R( ~ U/ q' f) m& r the name, username and department of the user9 L' Q- Q1 I( @3 C1 }1 @; ?
 the statistics of the comparison
( `7 v( V4 }; S# j( |- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different w7 e6 y# X, H' D2 H
 the recommendation for further checking @ ]8 G- }3 u7 _* i
- 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" Z; \( W& o* o2 j
 the names of the two files compared) A+ @/ P; `" V- X# f6 M
d) Leave the program (exit). x$ S9 m' q% v1 G
The ProgramCompare class: (Total maximum 20 marks available)6 S! P+ v6 t: [) `- `8 {, u2 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)% a2 ^7 g0 J* F7 W# z
a) provide an error message if the files are not found or there is a problem opening them$ @/ K! E$ [& x5 w0 P7 M$ h$ k
b) compare each line of code. O5 K! t) f k2 v
c) print out the lines that are the same
; s# f, v. `) s" Cd) count the number of lines compared / lines the same
$ |; U" A# G! P% d. `5 c7 q$ w' PThe AuthorisedUsers class: (Total maximum 20 marks available)
* V3 l/ ?1 \" L, y/ i; ~3 R3. 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) n1 m* X$ E" t" Y
4. Provide methods to:
+ e4 C5 s5 y, ], t7 N9 Z! Ka) 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
* T- h& F; Y' Y ?9 t# \b) return the name of the authorised user( N+ P4 a1 J, G; w) J
c) return the name of the department of the authorised user
( R1 [+ ~2 n, y- d% \Individual Data (Maximum 20 marks available) c, ?6 Q+ S5 x& s* Q
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.
, \$ r* w- H9 C8 s# F/ sDocumentation (Maximum 10 marks available)6 e. ?7 n v4 U' {' Z3 i
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.4 i6 i6 R9 f3 K( @# y& F1 K! S
BSA104 Business Programming – 2007: Assignment 2
9 ^( C7 B! R6 FPage 3 of 5 |
|