|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
5 e3 V, s6 L# Z q6 b: x& J( I* MShanghai - 2007
! W: @8 g8 @& e& j+ M8 wAssignment 27 s* ^0 s. J* a2 I8 [4 _* C8 W! C
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)% W4 p& g4 {6 U4 q
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.1 X# u8 t# r4 q% U
The staff must be able to:
) l+ b& M7 |4 Y4 n( r Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
( q0 f7 v3 | V6 J9 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.
# I+ D+ d4 X3 z/ \" G2 ?/ J6 ~ The interface should provide a menu so that the staff can:# ?0 d3 w9 M; N
a) Enter the names of the two Java program files to be compared0 [& w' d. W. O; C
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
. P6 t# y- [" P, ]9 c/ M4 Z1 s8 ^ }5 z** 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).
; l, _% \0 `8 q) o! q7 ?+ oBSA104 Business Programming – 2007: Assignment 2
( W& m& c! w4 j) {8 B' a! }$ ?/ [5 LPage 2 of 5' r- c7 z( A1 t. I0 y( i3 T6 E$ z
b) Print out to the screen all the lines of code that are the same
' {% `# \1 l: ~- e Include the name of the file and the line number of the code being printed for each of the two files
9 ?* f* K7 z) M7 u2 Hc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared0 S D' w' y4 X
 the name, username and department of the user2 o# l/ J. N2 h K6 W, I
 the statistics of the comparison
8 D. i/ `9 F: z) T+ `- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' m k) L/ O7 P0 k l; |9 \5 \8 e the recommendation for further checking" A9 m' |- h5 A6 W0 b5 n$ s
- 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) V7 W0 r, L% ~. C
 the names of the two files compared) }$ W7 ~5 S' l5 m* |9 j# C: ~
d) Leave the program (exit)
5 O+ n, Z, b' p7 ~1 fThe ProgramCompare class: (Total maximum 20 marks available)
' e# I) n, X7 z4 g5 D6 s, c# o2. 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)( o* z. [% l' ^' Z) l2 J& U& s
a) provide an error message if the files are not found or there is a problem opening them
2 q+ H( _; H' m0 e7 m1 d) jb) compare each line of code ^# A" P" X2 u8 ], Y
c) print out the lines that are the same r+ q8 c5 c k: ?) W: m
d) count the number of lines compared / lines the same
+ j- X5 g6 [3 W# U: W1 EThe AuthorisedUsers class: (Total maximum 20 marks available)
, z% g* i4 V0 j, k1 c. Z3. 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)" @* B+ T) M J" n! u. w- V
4. Provide methods to:, t5 ]' r$ K D7 B9 G! i
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 match8 F+ C5 ^$ i9 u* [8 J3 D3 Q
b) return the name of the authorised user
1 U# t* X4 d( a7 `( ^6 \7 O3 Dc) return the name of the department of the authorised user5 L2 p. j; w7 G, C* v& ]# N
Individual Data (Maximum 20 marks available)6 A) Q. u4 o' A5 L+ H$ j, [) 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.
2 y( E# j8 i9 J! Z9 ]Documentation (Maximum 10 marks available)
, W! @% K- s* S6. 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 E `) C8 G& n/ S9 |) D% {2 n
BSA104 Business Programming – 2007: Assignment 2' m, ` Z, z# c O: Y0 |
Page 3 of 5 |
|