|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming# K; I& y7 V y5 o2 s! y) Q
Shanghai - 2007; @) ?) M) q2 r# t& n7 ?
Assignment 2
$ q* a# Q' L1 u' C0 FDeadline 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)0 H! O! B# P, T) a+ |
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.
( _% E8 [$ X' h' k7 |; u& J" UThe staff must be able to:# _1 q' ]: B7 w" W; k* |$ J7 j
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.* y5 \) m* Q; V. r. W# l* W
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.) P/ g, r. ?8 h/ e
 The interface should provide a menu so that the staff can:
6 Q i1 j* N; h' ~1 ha) Enter the names of the two Java program files to be compared+ c2 k' P9 p' ]: t. G
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.) u. c$ q: Y O0 r# h# f( v
** 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).0 v; S2 w# b5 W- N
BSA104 Business Programming – 2007: Assignment 2# g) G, |. W6 j( T1 e' k9 \/ M
Page 2 of 53 p) t0 w/ a3 ?$ z% r2 q
b) Print out to the screen all the lines of code that are the same2 P. U5 I' H- {
 Include the name of the file and the line number of the code being printed for each of the two files# T! O; J# O2 z8 t! e5 m
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared, Y0 A; ~# p$ ]) e
 the name, username and department of the user
( |" x9 q8 L0 t- ]; ? the statistics of the comparison
3 {6 d$ T$ ? I: s! e) Z- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different7 r3 h) M+ M9 l4 m& a, O$ {% T% L
 the recommendation for further checking
7 {5 }$ T3 m& g: a8 l- 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 closely9 G: d t7 \; g# v
 the names of the two files compared& o/ K' N6 p/ w v* o) m
d) Leave the program (exit)
J. c* ^* M* F/ G$ ]The ProgramCompare class: (Total maximum 20 marks available): W K- m- X3 f1 _- p
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)3 r5 l( b' I/ Z! E: `( e
a) provide an error message if the files are not found or there is a problem opening them- m+ n H. ^% [5 {
b) compare each line of code7 G a" Y5 m- `- K5 U
c) print out the lines that are the same
; q- P7 M1 u& Y/ [d) count the number of lines compared / lines the same
# h: N& d+ S5 r' V4 @( o; uThe AuthorisedUsers class: (Total maximum 20 marks available)
2 V- ]6 v \# [1 g$ b9 b! K: `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)
* h2 J- f7 P+ B5 z4. Provide methods to:, `+ J. Q# j4 ?" {
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& N4 H. e* H" P' F( d* Wb) return the name of the authorised user
3 A. q# i. @: q5 zc) return the name of the department of the authorised user
, J" U& [9 B( f. Q9 ?3 I# j* oIndividual Data (Maximum 20 marks available)( v$ M/ I# k6 z! v
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.
/ f1 d$ s: i" H7 N% G/ S+ xDocumentation (Maximum 10 marks available)
0 f4 ]* m- t5 ?5 _7 n) J6. 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.
d& T" t+ ?4 s( L/ F, RBSA104 Business Programming – 2007: Assignment 2
) {2 p! L- L, v3 }8 n5 L: C5 MPage 3 of 5 |
|