|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
$ j# D6 g& B: t& J( AShanghai - 2007
: f0 R, k2 q' q. Z' ^. v- AAssignment 2
- ~7 s8 S# v6 p/ e8 i2 H6 M/ H `9 G+ 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)
# _6 X; _( e0 _3 m1. 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.
8 A/ e7 Z0 H5 Q! G" I ?/ c! a) T0 B: eThe staff must be able to:
: Z# l$ F' U& V1 m% k. V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.: l- |9 g7 h0 h! a' p
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.
8 z# g+ i5 Q9 k9 I9 A: ]: E The interface should provide a menu so that the staff can:
2 G0 Q. w2 G- G" ~; _a) Enter the names of the two Java program files to be compared4 c3 ^) G4 f( v" E8 i i8 E5 b
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( {7 f* c+ \; C' M9 j" t* P0 E
** 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).
' f; I" f0 |' K$ U( e7 sBSA104 Business Programming – 2007: Assignment 2
& H; M4 e' y$ d* ^& s" Z4 VPage 2 of 57 k7 O* A% r7 ?: @; v4 B/ H2 g
b) Print out to the screen all the lines of code that are the same4 ~& Z" c1 v% o& m
 Include the name of the file and the line number of the code being printed for each of the two files6 @3 _$ Y0 r Q" v, D4 `* `. ~9 B
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
! q w# M0 `( n the name, username and department of the user6 ?7 }' o0 g% m8 ]4 i
 the statistics of the comparison% @" w/ p' l/ L
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
0 ^. | T7 x4 {7 y l' @" `. ^5 b& f the recommendation for further checking8 T( Y! D# B& J2 A
- 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 closely1 e2 p' f0 U. d3 d9 ~/ [: U
 the names of the two files compared. O7 {+ x, j/ ~( s% S/ R
d) Leave the program (exit)
& Q- N3 o+ L; x% ZThe ProgramCompare class: (Total maximum 20 marks available)1 j( J* S( M3 Q* ^
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)0 M, h5 Q9 }* h0 V
a) provide an error message if the files are not found or there is a problem opening them
1 Q3 m& n+ [6 L3 Y' ab) compare each line of code
z& i0 Q0 p. u Jc) print out the lines that are the same- U2 z, ^* ~3 q
d) count the number of lines compared / lines the same j# p7 R6 @; _
The AuthorisedUsers class: (Total maximum 20 marks available)% R* f# l% \/ C0 {6 R8 J9 L5 N. M
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)
5 W4 [! W. E% D2 j7 X4. Provide methods to:
* M K. e$ J2 [& h5 Ma) 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
& D: r% c9 S4 g1 Y+ ?; Q7 e$ ib) return the name of the authorised user
7 a( D( K0 Z8 q2 U* j, H9 V9 Gc) return the name of the department of the authorised user
6 z0 g+ [5 A% ^Individual Data (Maximum 20 marks available)1 Q! W7 b3 e% Z6 U8 l
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. i8 ]0 E5 I* L! L" s5 P+ F, U
Documentation (Maximum 10 marks available)+ o& [' a9 s3 O' I; X- h0 S
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. m1 s5 }( l+ \
BSA104 Business Programming – 2007: Assignment 2
( V1 B! G( S1 B) S0 T9 hPage 3 of 5 |
|