|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
/ \/ w' f! Q% _& q; K; y, Q% m# V jShanghai - 2007+ Y2 |+ s7 V: t0 _" B. v
Assignment 2
6 i* ^, x" i; u: Y9 h `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)5 f5 c* D! I- J/ z. l
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.
5 W \$ k5 A( }8 A- B; T1 VThe staff must be able to:8 M/ ~' r+ ]1 }7 e$ K) y$ y
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 i! \4 I7 w9 A1. 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.
8 Q5 O5 K/ u& S, n! x The interface should provide a menu so that the staff can:0 Z& P0 F" b0 [( N/ t n
a) Enter the names of the two Java program files to be compared2 n2 b- @; a* l- m/ t" f
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 M& H! n! i0 I, x. u' a& 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).
4 B' L" L* t Q' e* \BSA104 Business Programming – 2007: Assignment 2; O9 b0 i2 K4 s+ Z3 c
Page 2 of 5( T9 F% Y6 R, K5 ^
b) Print out to the screen all the lines of code that are the same9 b( v E4 I4 s0 d0 [9 D9 y* k, n
 Include the name of the file and the line number of the code being printed for each of the two files
P1 {: X/ a: b1 c' v: t Cc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
' z0 {' T. v( [# ]% \4 e& E the name, username and department of the user" h4 W) e0 U! W8 w
 the statistics of the comparison
. O s( y* T8 ?5 F/ K$ V" c1 }- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 S: F+ \8 C) r1 A% h, d7 ?$ e3 P$ x the recommendation for further checking- Z% b; N3 s$ f( j: j
- 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: q e, }7 Z/ e# ]6 g$ p the names of the two files compared
& c( @* e3 f! n7 K+ Y1 | `7 gd) Leave the program (exit)
8 c! s7 U d: F9 ]1 BThe ProgramCompare class: (Total maximum 20 marks available)% u2 A" B" ?! ?
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)
( l* \! M4 N# X! {8 ]. }a) provide an error message if the files are not found or there is a problem opening them& n8 E% k* ^/ n6 X+ r0 W$ M, r
b) compare each line of code
2 G0 u7 v% |8 S" u/ dc) print out the lines that are the same$ D% |9 F5 G9 T3 ?
d) count the number of lines compared / lines the same* w/ N( ]! `9 }5 A* f/ e% e% g! X
The AuthorisedUsers class: (Total maximum 20 marks available). f3 H" g/ p, T% H
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)
# k* b5 p- P8 h* Q4. Provide methods to:
4 V- N( Y( d3 E5 j1 ma) 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
: e7 M+ |: E) [b) return the name of the authorised user) B" o+ v: p; r9 H9 F$ N8 w
c) return the name of the department of the authorised user: y2 G( D7 p1 Q6 g
Individual Data (Maximum 20 marks available)4 P1 e E3 V2 w% j _8 u3 |6 w% c
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.
3 Q( h& ?6 ~1 W) Q" w2 [Documentation (Maximum 10 marks available)
2 N0 c# _& f0 ~ \% A( w) w% b6. 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.
# y' |4 E- q8 s8 j0 h1 ^6 S7 L& N9 ?; NBSA104 Business Programming – 2007: Assignment 2
( G3 J# Q5 R* Q, e) `Page 3 of 5 |
|