|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming8 ] I" [7 i& B* p- s% k. P
Shanghai - 2007
- `, }% u- H7 b, s* }* vAssignment 2 Y' c# j3 W- S" G. o: M
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)
; q& b& d- m5 C h$ \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.
) T9 k! F2 R1 i, uThe staff must be able to:& A) q5 i0 G8 v+ w: W( _
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.4 R( z# c* ~: n& Y* Z
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.8 M/ b3 W4 W* D: m3 f
 The interface should provide a menu so that the staff can:
9 e2 q+ |4 x9 y. d6 m0 Va) Enter the names of the two Java program files to be compared$ I) {3 X# U3 t8 U* B- E# G& e
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.% n4 F2 o& G% z6 U, f! `- A
** 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 I6 N7 k6 j6 X! wBSA104 Business Programming – 2007: Assignment 2
; N Y% O# U, XPage 2 of 5; A1 Q4 q' p7 m4 _+ h. o; [0 _
b) Print out to the screen all the lines of code that are the same, r5 u/ @. s0 J* c; ~4 O
 Include the name of the file and the line number of the code being printed for each of the two files
4 S* D6 t, z3 Z: F% g) e5 fc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared P7 ?1 r/ i. G7 t( j {6 F
 the name, username and department of the user. c% R1 _" G" E v4 |' u7 A4 A+ N
 the statistics of the comparison
' Q m' F7 p+ T @% d4 \- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
1 a( \& J; P# `6 }9 p the recommendation for further checking
4 P) ?3 @2 a: H0 m- 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
4 ~; {" u5 v" \% X/ v" Z& l0 W the names of the two files compared" B3 Y7 t1 d- m5 I2 f+ z( Z& n# Y
d) Leave the program (exit)' K. {# k% y% J/ \) G$ X4 n7 r
The ProgramCompare class: (Total maximum 20 marks available)) U3 G4 e. v) d% K8 _9 S! A
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)
/ K' w3 ?: n3 H4 M: Ua) provide an error message if the files are not found or there is a problem opening them( ]% U2 u0 S2 y) L1 u! p" d
b) compare each line of code: t- T N9 j1 k8 n' @7 Y
c) print out the lines that are the same8 ]" y+ Q4 x6 t6 y
d) count the number of lines compared / lines the same3 e* r# X' t# H
The AuthorisedUsers class: (Total maximum 20 marks available)
5 N2 u: q4 w, w, g3. 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 u) t o' z; n' K* W+ S4. Provide methods to:! x# Y# N: p0 W {' E
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
4 ~% I' |: g! d- J0 Hb) return the name of the authorised user6 E* J7 f3 B" a/ S
c) return the name of the department of the authorised user( ~* i" D; B" W
Individual Data (Maximum 20 marks available)
( J/ B" \) ?' g+ ]% f' @. ?4 H# B9 _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.4 @0 r% c( G- J* G
Documentation (Maximum 10 marks available). @" k% g. {5 s3 x* p4 F
6. 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.- A) s; K d1 j0 p7 a' @1 b
BSA104 Business Programming – 2007: Assignment 2* T. G# B0 s1 E9 h3 ]& [7 p4 g
Page 3 of 5 |
|