|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming! |- i0 v7 q! H/ A0 m9 v
Shanghai - 2007
& j9 E+ i' V9 J1 vAssignment 2- K1 H9 C; `* U4 n* }- l
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): x/ A# n$ w% y
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.
2 ?6 ]+ o' \; `) l& W0 d: |( YThe staff must be able to:
P u0 n# n( A( D+ u6 ^ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.' M! Y; f! n! Q$ P. X; L( m" L8 X
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+ d3 R, F- L2 y" t# \ The interface should provide a menu so that the staff can:
7 E+ C2 }/ z* f/ n2 Z3 b( _a) Enter the names of the two Java program files to be compared
d" a8 ]) F' G/ z# P# R8 K For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
& T2 |! j8 B! W** 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).
8 A* ?! d. w: ~! m& h$ fBSA104 Business Programming – 2007: Assignment 2
4 b) h% h4 z3 {4 n4 n% y8 tPage 2 of 5
" i3 a9 l4 |1 F* S; v1 X5 Lb) Print out to the screen all the lines of code that are the same
+ k9 v: x w3 b: I! b# z Include the name of the file and the line number of the code being printed for each of the two files% \$ f" A0 M: P3 g! K/ T' X5 {5 w& y
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
( X" t0 G( x7 K3 g' p: z9 t$ O. w the name, username and department of the user9 o; c( p5 ~9 o
 the statistics of the comparison5 }! M2 z# v. K0 t+ f8 Q* D! C
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
: C; r2 j/ X+ y6 z' K3 ~$ a9 s the recommendation for further checking
- }" }+ ]4 u* W, R3 w& a- 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
. I" e. y# z9 E8 z+ A2 w3 e the names of the two files compared
8 z8 m; S! F3 Z6 S: O6 Wd) Leave the program (exit)! e: O) S; {, P# W/ S) L
The ProgramCompare class: (Total maximum 20 marks available)1 m3 v; g3 z5 {& y
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)
1 Z' y- M6 Q* S7 D& S- S8 Ka) provide an error message if the files are not found or there is a problem opening them
+ @$ t* H/ X6 q9 c; Yb) compare each line of code
" X k0 f- I3 N& E% \- m! Q5 b( }c) print out the lines that are the same: w2 I5 ~* _8 V
d) count the number of lines compared / lines the same" Z, L% M; Y. [. Y5 \$ E! M' N( e
The AuthorisedUsers class: (Total maximum 20 marks available)8 T% S/ [9 N. S4 _" U1 u/ c
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)! Q/ M" A! _& p, c
4. Provide methods to:2 F7 w: `: R y. P
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 match2 c5 Z* ^5 u# T
b) return the name of the authorised user
4 i7 \. X1 u0 g. Qc) return the name of the department of the authorised user
. W% |1 M; ~! Q, I; \6 O) wIndividual Data (Maximum 20 marks available)+ D7 R/ y4 L& K. H7 {! S
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.+ K3 q s* {& g
Documentation (Maximum 10 marks available)" T7 J0 x2 k3 k. i/ J5 m
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.. i% D* Y% K# g+ h7 u9 _
BSA104 Business Programming – 2007: Assignment 2
: k3 v, W" }) Y8 O* v: GPage 3 of 5 |
|