|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
3 ~) |1 p; }$ C% n3 ~Shanghai - 2007/ Q) n& D: W' u* F* I) e# L
Assignment 2
+ C, W: A7 N( J! U" D& l* H2 MDeadline 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)2 c( u/ U) N( j6 |* ?6 }
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.
! o/ z6 p4 I3 r/ i7 nThe staff must be able to:! C5 i$ T9 \" C# c& L, E7 o. z
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
+ w; q" i) Y) a2 z9 ^# H% N1. 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.
+ x' O' e" }& |, R; ], y The interface should provide a menu so that the staff can:
* B' A, \. ?) i j: _) C* k6 ia) Enter the names of the two Java program files to be compared
- p( V1 U+ Z$ K9 Q For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
" U' }6 p4 l0 _** 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).
9 U( p6 g1 e5 U8 c) qBSA104 Business Programming – 2007: Assignment 2
6 f( S& J# \$ B0 f/ _Page 2 of 5
3 Y( D$ N' \; G: _# Y+ \7 }7 y7 }b) Print out to the screen all the lines of code that are the same
1 a- v( r# G( B K! q Include the name of the file and the line number of the code being printed for each of the two files9 k2 X' {. g( K' \6 J5 Z
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 M8 _+ _. R# M" Z the name, username and department of the user: `* M @; ?' B4 P) Q- X; V7 }
 the statistics of the comparison
2 {& Z" D- S2 `6 H. R+ F! O- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ B0 W- V9 r* T9 V- ~ the recommendation for further checking1 O( n4 j1 w, ^. n; v
- 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
7 k5 C7 j! i, ], r the names of the two files compared
$ K3 q, T z8 o& Md) Leave the program (exit)) I7 p/ Z! y4 g
The ProgramCompare class: (Total maximum 20 marks available)
, ~: q& z; P; p' ] J6 l# H) C2. 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)
" E( l! ]2 |" A) ]) G+ K* Na) provide an error message if the files are not found or there is a problem opening them0 z& E7 m$ a( w2 I
b) compare each line of code0 { O" A9 t) Q& A# H% u) A$ E
c) print out the lines that are the same) |, h2 o2 ^; Z! w# e. o
d) count the number of lines compared / lines the same
* @/ V* m4 r6 a/ BThe AuthorisedUsers class: (Total maximum 20 marks available)
; X0 i' Z* Z& L" u5 t% O( j3. 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)
$ ~; S* S4 {( `% U4. Provide methods to:
! [$ P. K" f: W3 Ha) 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
7 ~! H; Q# _) Y- tb) return the name of the authorised user; M3 E4 h$ _- Y$ ?
c) return the name of the department of the authorised user
3 B. Y# n% b9 n) r: CIndividual Data (Maximum 20 marks available)
; a9 x% w+ V- x$ _2 k/ _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.
7 {; r# L9 O0 r" V+ b3 _4 wDocumentation (Maximum 10 marks available)
- H# @/ ?2 I2 G6. 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, `5 ~/ N, G% BBSA104 Business Programming – 2007: Assignment 2! j( t' n$ R2 V; |, f9 n
Page 3 of 5 |
|