|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
/ `5 b( P) M& e! Y0 _- I/ OShanghai - 20075 }7 o: J) `2 `; t& u5 Z
Assignment 2
/ C1 }2 x% o1 X# p6 h2 H1 IDeadline 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)
! l+ O5 D* S) R. y1. 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.& z3 }4 T% _6 W& D# Z( |5 l6 C
The staff must be able to:
& P# y* K d( u Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
# E# f9 Y5 R- w! X1. 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.
0 X5 F7 v' Z6 Z/ V; m! g0 x0 w. X The interface should provide a menu so that the staff can:
3 Q- l) X4 u% Y! wa) Enter the names of the two Java program files to be compared
( Z' E9 u* Y( F! \" E. n. o For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
3 G! _( D: C& x) D8 P( h8 p** 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).! q- }) s3 e: m! M: k3 V% E
BSA104 Business Programming – 2007: Assignment 2
9 y& D- X3 s5 i) cPage 2 of 5$ M( C+ _% C+ ], A
b) Print out to the screen all the lines of code that are the same
/ v3 W& q9 i. } A |, V: c Include the name of the file and the line number of the code being printed for each of the two files
& R" |' q- H( i5 d( cc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; _- V9 _" I. y/ [# |5 \8 m/ t$ } B6 o the name, username and department of the user
# v% O$ W0 h3 D the statistics of the comparison
( {" W( y0 v6 |2 h- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
h/ \5 [( H1 i( h9 a! S0 h/ M% P the recommendation for further checking ^( |0 {) E5 {' z
- 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 closely4 I1 W5 p- s3 N# l4 R' U5 g
 the names of the two files compared: L! Z5 O' ?. }# g% y
d) Leave the program (exit) [) m/ X3 c& ]( k
The ProgramCompare class: (Total maximum 20 marks available)( |: [( l! }* Y1 n6 }
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 ~2 J$ }/ j# q% `9 M3 i" T
a) provide an error message if the files are not found or there is a problem opening them
6 y- s# Y2 G5 m. }9 _& Lb) compare each line of code
0 N/ p! I' G4 O& W1 s% }* qc) print out the lines that are the same7 `$ d8 G! A. c- }' h
d) count the number of lines compared / lines the same V# h. @) Q' ?. a8 l2 i
The AuthorisedUsers class: (Total maximum 20 marks available)4 U" V9 A# s* @* t
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)
o9 }2 z* k. N! A% P4 W4. Provide methods to:
% C2 y3 f# i, x: Z/ d' k" Ta) 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
- }+ B& P6 O! a9 ^3 f4 z/ y+ Rb) return the name of the authorised user
4 R" R3 z: ]) j$ x4 D1 Ec) return the name of the department of the authorised user
0 C( T! U3 B3 Y$ o' E; g) Z5 _Individual Data (Maximum 20 marks available)
% M* n, k9 l; i6 I# X5. 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.
7 l1 x! h2 G! s6 ^, [Documentation (Maximum 10 marks available)7 x( c! b) p1 m9 b& S0 d
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.
& V" E0 R* Z% x4 Y0 e/ rBSA104 Business Programming – 2007: Assignment 2
5 x; F/ Q3 g9 X% Z5 k, oPage 3 of 5 |
|