|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming- Z* Q) ~8 W, C# x- `
Shanghai - 20075 K/ L) S z2 j1 J
Assignment 2
3 }9 q5 ?2 l- p; Z' |; vDeadline 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)4 X d: B, ^& s U% l' w
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.* o6 F0 Y7 t0 H7 g4 l
The staff must be able to:$ P5 @" N% R. o* T, E2 f! N
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
0 P, R* ?' s, N7 i7 Q1. 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.5 F' l: R, s3 R2 t! r
 The interface should provide a menu so that the staff can:, }+ z% `0 K) u: b5 `& o6 n) L
a) Enter the names of the two Java program files to be compared
e& r! n/ F% O! c For this assignment, it will be assumed that the two Java program files are in the same folder as your program.$ W; m( v8 V6 M6 K2 E k
** 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).
7 r0 H$ l. ~2 b0 c! a: I BBSA104 Business Programming – 2007: Assignment 2# `6 b/ Q/ Q( \5 ~% ~% B) X6 T
Page 2 of 5+ H- N6 }3 p4 i# W0 M. z1 [
b) Print out to the screen all the lines of code that are the same% S/ a( X1 h: l t7 Q, i' ?4 Q
 Include the name of the file and the line number of the code being printed for each of the two files$ u9 K1 C% s; j6 ~5 q# y
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared# }( r+ B+ a5 E6 _$ j7 B
 the name, username and department of the user
( ~( J2 u) D2 z) _" E1 b the statistics of the comparison
+ H& ?7 K% S" D! a- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different# h% D' X3 n! S+ {
 the recommendation for further checking
& m3 n7 P0 O; p7 _5 [3 ]- 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
, H' g9 d2 H' I' k6 r6 Q the names of the two files compared E; z( b& ^) E# `8 w- n( U
d) Leave the program (exit)
. q, h/ m) m% W2 J! Q8 ?6 |The ProgramCompare class: (Total maximum 20 marks available)) P3 z5 E8 }6 s% H% a$ R* I# h
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)
" B+ \* Z, i% h! ha) provide an error message if the files are not found or there is a problem opening them/ q+ V) m% s% l
b) compare each line of code
& S. B2 L* r) i( W* p1 b5 C6 Lc) print out the lines that are the same
3 G; Q" ?! ]4 f* {d) count the number of lines compared / lines the same7 c, p* A Z) N, o2 i; L7 k
The AuthorisedUsers class: (Total maximum 20 marks available)7 h G* J2 O1 V3 `( Y" H' x
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)( h6 _" p0 V) j3 n2 y
4. Provide methods to:
; B8 w" G/ w2 g" m4 n9 z! \- C7 Ra) 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
3 O! Y+ w! L* u5 u! gb) return the name of the authorised user% Z% @6 B* K! S; a; i- Q
c) return the name of the department of the authorised user
) Z$ J6 ~3 Y6 RIndividual Data (Maximum 20 marks available)
8 y1 S' K) {) O5. 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.
# b4 m, v+ A9 P" l, qDocumentation (Maximum 10 marks available)
7 a( X. ~# b- z, O3 A. Q6. 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.
+ {; Q: G; u+ a- N+ s, y9 Y, e& ~BSA104 Business Programming – 2007: Assignment 27 E& Y6 r! a! U0 V/ s
Page 3 of 5 |
|