|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming! N5 ]( K% ~# O# j$ p
Shanghai - 2007
3 E9 X( K# k8 l" O. X9 oAssignment 2 I% |9 F/ ?' Y/ Y% F' w
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)# d1 ~2 d% B& p# Q
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.
, Z' j4 r$ e) L, SThe staff must be able to:; u: u) D* m0 M5 ~" m- z
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
6 v- G8 O2 j4 k% }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.5 S8 z6 S B0 E; E$ D2 W
 The interface should provide a menu so that the staff can:
2 `" N- b. w8 a# b4 s4 wa) Enter the names of the two Java program files to be compared
2 O( u) s/ G! N6 ~- [ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
8 g: F+ S) j, {( s9 v5 ~$ J** 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 y* j. D6 B# Z3 a" D, q
BSA104 Business Programming – 2007: Assignment 2
" I/ B3 }$ _7 v: y# G- fPage 2 of 5
5 c; K3 _5 H$ l9 \* Cb) Print out to the screen all the lines of code that are the same, _/ c: z7 S! G% J
 Include the name of the file and the line number of the code being printed for each of the two files" s- V- a4 X8 i
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) v0 c( g4 j$ ^) m6 V
 the name, username and department of the user+ S9 n1 v' K; P- u1 P4 x
 the statistics of the comparison
$ f" t7 G4 @% J* ^- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
_# ^, O0 q* o" B$ Q4 N6 T' H; I F the recommendation for further checking% T' [7 u6 _& f6 n; P
- 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* p: ?0 u E$ z9 O K$ n5 { T
 the names of the two files compared1 X3 l9 l3 ]$ S, ^4 [8 r! `
d) Leave the program (exit)
( ]/ {7 c' d X) MThe ProgramCompare class: (Total maximum 20 marks available)
, H" x( B' C" h3 C. {0 O) ~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)& `" j4 a' s f6 e+ ^+ ~2 r+ o
a) provide an error message if the files are not found or there is a problem opening them
' w& }9 u3 f3 D0 pb) compare each line of code
7 C+ i4 A* O+ a O2 P& ^c) print out the lines that are the same" e& R8 g9 Q1 z v
d) count the number of lines compared / lines the same! A, n4 ?. j' s( M
The AuthorisedUsers class: (Total maximum 20 marks available); R/ q* ?: R9 s* x
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)' }+ g/ K- {0 ^# _6 T
4. Provide methods to:
) T" G0 D g2 d8 {0 @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. R6 ?$ }& ~4 m: x; u) r
b) return the name of the authorised user
/ @) w/ g/ Z& Jc) return the name of the department of the authorised user
+ ], A7 \" x( q% i* p( w; F$ N- HIndividual Data (Maximum 20 marks available)) T: Z# ^9 x# W( Q8 ]- k* W8 Z
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.- b' g) F8 c t" A: \7 n
Documentation (Maximum 10 marks available)
7 U, ^: T. |1 \' o7 c3 Y' X6. 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.
* `; m& P, k) eBSA104 Business Programming – 2007: Assignment 2% N& }8 Y5 P0 X6 s. o+ W% K( `6 _
Page 3 of 5 |
|