|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming1 ~9 u; T) K% Q
Shanghai - 2007
, A! V1 @9 {, {( JAssignment 2+ V. i6 v/ e& }+ T! Y# r
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)/ M* f( n# I1 {9 y0 W( N2 o
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.
3 i$ w, q, b! }! K8 \3 w9 h# WThe staff must be able to:! Y; V' P9 r( |# u
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **." g" W* X( z7 d
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.: o- _+ W+ M @6 Z
 The interface should provide a menu so that the staff can:
$ Q4 K, P+ _; j3 {8 T7 |a) Enter the names of the two Java program files to be compared% F& q/ G0 H' h8 ^
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
" J- p) q3 \: e& E e# ~3 J/ y** 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).- I; D, }2 `+ p* a0 M/ ~. u
BSA104 Business Programming – 2007: Assignment 2
5 j9 o( c5 w2 J# c& W XPage 2 of 5
7 `2 W# O3 T$ h1 B" W0 A. W6 J1 pb) Print out to the screen all the lines of code that are the same
3 B2 H$ {! F. E- X6 q Include the name of the file and the line number of the code being printed for each of the two files; w7 T; |& l3 A2 U( W/ P4 |
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared4 _; }7 Z: [. q( y. T
 the name, username and department of the user
" V- @8 }5 | j' Q" }* O the statistics of the comparison
& N# @# r) P9 ^& H' ^ C# H. f( f @- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
* P. |7 O: x; t* L) t" n4 n the recommendation for further checking
( j3 b, ?7 V2 r6 I- 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 closely2 z7 O) `! ?! j; I
 the names of the two files compared
) |) I' h& Y4 J+ Y) |) _( s0 ~( yd) Leave the program (exit). z; q9 A3 r" X& I
The ProgramCompare class: (Total maximum 20 marks available)
. D7 R4 J- t- P v! o. k2. 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)
; f+ Y; h5 G$ Sa) provide an error message if the files are not found or there is a problem opening them6 ~& @+ i% F: Y
b) compare each line of code0 P; ~" K0 F* y6 h4 H! Q
c) print out the lines that are the same- f" V2 Z+ g: b' L: _* N1 Z: ~
d) count the number of lines compared / lines the same* I5 |. L7 D/ h9 A
The AuthorisedUsers class: (Total maximum 20 marks available)
* g* |) Q* O/ v, h$ H" O2 ]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)' j9 ^- p" i4 f8 o
4. Provide methods to:- g+ R* ?% Z5 @* Z6 L8 v+ x! W
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
) U, \+ G, k5 |5 k5 o) L3 a. yb) return the name of the authorised user
+ V) @8 F1 |5 a* C% S( sc) return the name of the department of the authorised user
) F0 `/ R3 `# g* l2 W7 HIndividual Data (Maximum 20 marks available); p8 y/ o2 i! z2 J5 t
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.
. a& D7 D9 P0 f+ k) B3 s2 Y" aDocumentation (Maximum 10 marks available)6 D$ H, e% } p4 z( {2 o! D
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.) n/ g9 R% L6 G. M
BSA104 Business Programming – 2007: Assignment 2
7 y9 w4 C F9 Y$ y) \Page 3 of 5 |
|