|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming" a2 {1 S: ^, i# d
Shanghai - 2007
. m# s4 x% P7 ~# T/ }' a( sAssignment 23 q- `3 \! n6 r9 Q; G% m# T4 T2 K
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)& ]! [ _: y$ L% H0 ?
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.
" u$ @3 a( Q! ^& G7 u5 A$ pThe staff must be able to:
0 N( K! U2 a0 z! o Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
' O( F! R- a/ j2 _5 W4 C2 _' V1. 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.
; T" [! z$ g, b0 c7 a The interface should provide a menu so that the staff can:5 t8 R. s% x1 t, m
a) Enter the names of the two Java program files to be compared# g( Z$ |) C& G5 ]7 t. C
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program. |) ?, a! B. ~# l; S7 D" }$ 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)." G- K" A8 l; J: y) O
BSA104 Business Programming – 2007: Assignment 2" h5 s* p( R# @' r8 W6 }' f1 n
Page 2 of 52 N* c. Q: }. P+ U1 S: }
b) Print out to the screen all the lines of code that are the same
, H% e& o) ]: M$ d- c, y) F3 ? Include the name of the file and the line number of the code being printed for each of the two files
0 U/ X' v/ ?3 e" x, ^c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
. c/ l0 S1 n& q7 X- [& k the name, username and department of the user
. Q8 H; ^4 i3 }+ r3 S3 I the statistics of the comparison
* {9 W+ u g: Q& k/ i- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
& r0 c# B; ?2 Q. B6 q4 O& U, p/ q- `( C the recommendation for further checking5 ~2 |1 b2 x% }6 K" ]
- 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 closely6 }7 U2 t7 k4 d; {" V
 the names of the two files compared
7 t6 y e) t- P2 Td) Leave the program (exit)
% H: D) X& K- w0 M, ?( o, i9 CThe ProgramCompare class: (Total maximum 20 marks available)
, [; E1 Q7 b. ~5 T2. 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)2 P/ Z7 O2 s$ i# h( _+ X1 S
a) provide an error message if the files are not found or there is a problem opening them* n8 s" c- e+ Q
b) compare each line of code
! s5 ^5 } n7 y: x: i) B Gc) print out the lines that are the same2 k2 K' K! _1 M( y1 Z
d) count the number of lines compared / lines the same
' U4 ]& v8 i) K( v7 D' WThe AuthorisedUsers class: (Total maximum 20 marks available)
! ]; \6 A5 @- ~, d5 G3 T$ F3. 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)
! b9 s! a* j# [5 R4 C! d4. Provide methods to:
b4 ^/ c% C3 L( b" H; pa) 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
4 c4 ?0 s* N( N7 G. V5 Kb) return the name of the authorised user
, C$ m4 ?+ |" M0 i, C# o6 bc) return the name of the department of the authorised user% x" U4 V% a" w; ~8 h5 a# K
Individual Data (Maximum 20 marks available)/ v& L% y( z( I4 {1 k5 z" h* x
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.1 T! Z0 c8 M; V |5 ^. z7 {7 Z A+ p
Documentation (Maximum 10 marks available)
$ `! F8 n* a$ c) ]+ g/ x$ J' `* K$ T6. 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.
5 y, X; Y$ y: z1 N- ZBSA104 Business Programming – 2007: Assignment 2
; F- B% M. L8 P7 zPage 3 of 5 |
|