|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming Q6 G- i7 G$ t: P5 ^8 D' ^
Shanghai - 2007
# @4 s5 {4 @: h$ {! e* e3 _Assignment 2
3 U- F% w- r: Q- c( [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)
1 W, I2 t* s8 v# U/ }# T8 b5 E1. 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.; g4 o _* @$ c' h, Z
The staff must be able to:6 r( z% _8 e) R, p& I6 }- O
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
' V+ v* d r8 c" K1. 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.
: i t( a* p% a8 S The interface should provide a menu so that the staff can:
$ m4 P9 i- p/ E: ^# la) Enter the names of the two Java program files to be compared
- [ u. v8 |; t6 I$ U5 H For this assignment, it will be assumed that the two Java program files are in the same folder as your program.* @" r$ f8 i3 {" G; x) n
** 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).+ R$ i- @7 j p# v* I0 B% H
BSA104 Business Programming – 2007: Assignment 2, _1 D$ v& g# H7 j0 F
Page 2 of 5) P. M9 ]5 t) z
b) Print out to the screen all the lines of code that are the same
* r; G9 s8 q1 y7 J& c( D3 G+ k Include the name of the file and the line number of the code being printed for each of the two files ~8 T2 @- g% Q2 ` K# v: \
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared3 K' I, N2 c- q, s- a
 the name, username and department of the user- w" ?3 \8 }2 R4 ?5 H# O8 `, s
 the statistics of the comparison, Y/ i& q, z4 e3 ^: d
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ M9 B2 ~6 |3 Y; ?/ c+ N
 the recommendation for further checking
@" s% V: w1 W2 ]% l5 G0 }- 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( @+ m5 K# r# v. V# o! n
 the names of the two files compared- Z# H' z/ B' C" r3 q! T: E
d) Leave the program (exit)
& U; `. k: a+ rThe ProgramCompare class: (Total maximum 20 marks available)+ y, u( x+ C5 ~3 ?) q' F% [3 ~
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)' T: F9 z: M C; m+ t3 u
a) provide an error message if the files are not found or there is a problem opening them
6 ~* ]& T+ l# f: r& S) ?b) compare each line of code
& _) l# h8 [# `8 Lc) print out the lines that are the same% z' ?% y7 w( K" k/ T J# b
d) count the number of lines compared / lines the same
' B' r6 I3 c6 M$ n: c- D; W! j. BThe AuthorisedUsers class: (Total maximum 20 marks available)
+ [/ |0 O' a4 ~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)
' _8 K5 }! m+ g, ?4. Provide methods to:
- c, W# \6 W0 E- pa) 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
9 N& ^3 v: d* C1 ?) ^" ~! ^b) return the name of the authorised user7 m7 ?% D5 ~+ _* C6 X
c) return the name of the department of the authorised user% ~7 [7 U8 b, n6 q6 N
Individual Data (Maximum 20 marks available)
+ }/ K8 u% D) E5. 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.+ m( v$ C* L2 y
Documentation (Maximum 10 marks available)
* o& V) U3 o2 v0 l3 p/ Y6. 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.
4 {% U: c0 K( O/ N6 U( G5 q3 wBSA104 Business Programming – 2007: Assignment 2& M' f, V& Q0 Q4 R: o6 M
Page 3 of 5 |
|