|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 \4 D/ ]2 N3 M/ M" E$ t" d
Shanghai - 20071 y% \5 M. k( S: I( E/ Q4 G7 F
Assignment 2
7 r% k2 k1 V8 w2 C. hDeadline 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)
9 @1 Y; r' d) O }0 E5 m, {* J1. 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.( L- R( ?$ f1 V D. d
The staff must be able to:+ A) f6 i# j. O( k; Q0 h$ y+ h
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
* r1 m2 W" _4 q- y# f' o5 K6 X/ ~$ r% 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.) D* M" J5 m9 S. u. v
 The interface should provide a menu so that the staff can:3 }% Z7 R4 {/ a0 r2 z, _6 B; Z% ]
a) Enter the names of the two Java program files to be compared$ A; j2 Z# u& t7 W6 }& G8 Z
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( b+ y4 O+ Z5 f* |
** 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).. A* e7 ^/ d; x. ?4 X$ f& Q! g
BSA104 Business Programming – 2007: Assignment 2
. u3 \4 I$ k3 o& X1 KPage 2 of 52 q- n5 h. }; L" H3 X* L9 f; W/ ]% g
b) Print out to the screen all the lines of code that are the same
7 p1 e! R$ m }0 n Include the name of the file and the line number of the code being printed for each of the two files C. z5 O. L" x
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared- W- B' O- Q( n! o& g m2 b5 }
 the name, username and department of the user
) @% n# q! B9 F. L: b the statistics of the comparison( @ I+ R7 F: ]& r! Z! L) {! o# [3 {
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 U; @- A( F2 `; @$ z the recommendation for further checking: O# ~* ]0 |( L- V, i4 i$ T
- 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
1 A# |* T* C5 F1 e V the names of the two files compared8 a7 e+ y& `" ]+ v9 i
d) Leave the program (exit)& ]' g5 E+ h+ Q$ w
The ProgramCompare class: (Total maximum 20 marks available)
4 [) v E2 h5 u: b% v2. 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 A. I2 [( H* ^$ @9 x: P
a) provide an error message if the files are not found or there is a problem opening them, N/ D" W( c4 R- ^2 ]( q
b) compare each line of code
1 i: n9 i) s) D2 S- o1 Ec) print out the lines that are the same3 c# u) {; n |. f9 D
d) count the number of lines compared / lines the same5 `# G+ G% \7 o- \) b" Q/ t
The AuthorisedUsers class: (Total maximum 20 marks available)
9 R! D6 B1 r3 L0 C0 _" t3. 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)
. h$ x: ~2 p. @8 C4. Provide methods to:& L Z, D8 t2 e" C" B
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 match$ ^/ x; s- |$ a4 J3 J7 f5 P
b) return the name of the authorised user
) `) O# d) C Y0 Gc) return the name of the department of the authorised user
! s' H" e: ~4 B6 _6 V( i! CIndividual Data (Maximum 20 marks available)
* \( v, k0 q! G( G1 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.
; g* K5 B& `( Q. U# @) vDocumentation (Maximum 10 marks available)
9 d' N" a6 w! _- q8 [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.
! F$ `9 X6 K$ `BSA104 Business Programming – 2007: Assignment 2
+ U0 ^* r+ O$ r$ q0 g& FPage 3 of 5 |
|