|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming" F% H) D/ g( w! X6 G& V' T( a7 o
Shanghai - 2007
$ e; I, B- f, ^$ S k7 x* i0 Q# WAssignment 2& m* B/ w A; D' {6 y. r" Q
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)
& i: p, o1 o9 h( _1 P- X1. 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.
( } u0 I s5 \9 P6 V3 h( ZThe staff must be able to:
$ P/ N. k1 m7 h! K Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! d9 `! h( U' T+ m5 j
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., W% h/ ~0 z3 x* X/ V
 The interface should provide a menu so that the staff can:3 e+ Q/ e/ H4 }( S
a) Enter the names of the two Java program files to be compared0 T; R- Q( E7 q1 N3 C
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.! o# K' v( b* e. m4 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).
) y4 [% y: t) E4 CBSA104 Business Programming – 2007: Assignment 26 ^ i. b; _ O2 k( g
Page 2 of 5
0 P! I. _5 Z0 kb) Print out to the screen all the lines of code that are the same: Y. p- M9 B2 o' _/ p
 Include the name of the file and the line number of the code being printed for each of the two files
{' M2 D3 A4 p% H9 l& S/ Lc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
- m3 t8 M# g# ?& b, |' {3 X the name, username and department of the user& c5 c: ^7 ~$ i( I
 the statistics of the comparison
. E# n! N0 a) `: c2 m g+ U" q) i- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ o4 j1 z; z# L3 ^
 the recommendation for further checking2 B! o8 v; Q0 P. B0 |# g" q
- 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" J ^ Z; U/ X
 the names of the two files compared4 E' ] i* b: H, P1 h- S/ O
d) Leave the program (exit)! d, w- D2 X( x% C$ o4 C3 }
The ProgramCompare class: (Total maximum 20 marks available)
# b' X: O" r8 L: {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)
5 l* u' g S. q) p( z6 N# G8 {! ba) provide an error message if the files are not found or there is a problem opening them
" x$ _6 d0 q! | P, H/ q4 f4 m+ @b) compare each line of code
) }7 W' X/ y" d; x" g% `0 O: U6 Ec) print out the lines that are the same
6 I4 |6 X# p! V T2 h( Sd) count the number of lines compared / lines the same
6 k7 t4 y( k9 z [& E. \The AuthorisedUsers class: (Total maximum 20 marks available)4 y8 s' Q( w0 D; v$ S! \/ ^
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): @' x! K4 y e0 C X. ]
4. Provide methods to:
2 y3 g% D% |6 S3 l1 xa) 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
" ^6 C8 N" _- fb) return the name of the authorised user
/ U! x( N3 O2 [c) return the name of the department of the authorised user
0 V; L5 W" F J$ h n- t' [Individual Data (Maximum 20 marks available)
' c" \$ a; e- _4 u4 G0 v% r5. 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.
. Q1 D; `1 t/ a( qDocumentation (Maximum 10 marks available)
|2 z4 F& m* F0 D9 T0 v. I0 {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.
+ E Z- c# E" j- N3 L* UBSA104 Business Programming – 2007: Assignment 2
6 h0 U7 L$ E: [! ?) h, S3 RPage 3 of 5 |
|