|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
! \+ |( z9 Q3 m) cShanghai - 2007
9 O* A* @6 b" \; w( M2 m/ UAssignment 2
; Y0 C6 N9 W# H/ X4 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)6 Y/ ]) v* I/ @9 Q {3 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.
6 ?! D" k* [7 t* a# V5 {The staff must be able to: @) ~: D! ^# @
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., [0 m6 i% k7 ~6 i
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.7 I* E) l$ h i4 O2 ]) R, c
 The interface should provide a menu so that the staff can:
* q9 I; W% W. S6 O6 za) Enter the names of the two Java program files to be compared! f3 u% M5 S: T6 A$ b: e. ]
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.% S! e+ q g q$ b; m0 P l! V6 M
** 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).& I7 B$ f+ \2 e' _" g
BSA104 Business Programming – 2007: Assignment 2
# {5 ?# z" O0 R9 {9 ?' f9 rPage 2 of 58 M4 P1 ?: N% P8 s% R& }1 P3 W
b) Print out to the screen all the lines of code that are the same( \5 Y/ ~/ o/ ?0 v8 P5 x/ a* ~
 Include the name of the file and the line number of the code being printed for each of the two files
G' M- v" F& s' v. Wc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
. M# B& ~- d) X3 G' o' p' Z; V# h the name, username and department of the user( O# j' W1 W2 h
 the statistics of the comparison
# p1 `! q* ]# b g9 e- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
* o7 q' P7 H) b1 y, G0 T% f' R# Z the recommendation for further checking. ]% ?3 M- q( I/ [2 f
- 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& D8 u+ T7 G1 A+ y' G
 the names of the two files compared
' c& \, `2 K& u2 i8 T* x Nd) Leave the program (exit)9 l) T5 N! b4 w0 G, K: a, s, X. i
The ProgramCompare class: (Total maximum 20 marks available)+ P- k; ?! Q: e0 {9 }, u6 W- `
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)
$ G3 U7 D5 F" Ja) provide an error message if the files are not found or there is a problem opening them
3 S1 ^& E* \9 r3 _b) compare each line of code. l$ t+ Q+ F% c$ K
c) print out the lines that are the same9 h% y" y( ^" S' [3 E8 g0 c6 i0 j
d) count the number of lines compared / lines the same
9 G0 H2 _. M4 B6 FThe AuthorisedUsers class: (Total maximum 20 marks available)% I. k4 H6 m; W" }
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): r* \$ n- e9 ]( F" O
4. Provide methods to:
' I& V% q( E) l. ?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 match6 b% q7 g7 b+ F' G$ D ~
b) return the name of the authorised user% D" z- E; y. _1 X" X% e! `
c) return the name of the department of the authorised user, q+ A: @+ p9 A7 l3 G1 c6 Q
Individual Data (Maximum 20 marks available)
# R2 _1 ~5 f6 _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.
8 C4 C$ f: l, O/ kDocumentation (Maximum 10 marks available)3 m- E5 i* s/ X1 t
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.
' I4 q6 f) T$ g! m( iBSA104 Business Programming – 2007: Assignment 2' n. I- [- Y9 { i# y3 {
Page 3 of 5 |
|