|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
. @& a, {- `" A2 r0 \0 JShanghai - 2007
# ? V# G4 H0 P6 XAssignment 2
7 n. f R, T7 f. g* N1 ^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)4 R* l7 _( f+ G" e; r
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.
& R4 |2 ^: h" l* z. cThe staff must be able to:- @5 S+ c% p) h$ M4 v( L
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.. }" E' a+ ~7 ^3 M: f
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.
! q7 [; ~/ w4 m; d8 M$ o2 k" z The interface should provide a menu so that the staff can: a F, t- X) ?6 ^
a) Enter the names of the two Java program files to be compared
. z' n# N$ f' P# X! ? For this assignment, it will be assumed that the two Java program files are in the same folder as your program.3 v! q! i; M' r% E) [
** 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).& o, E. V8 T$ X1 {8 W$ e6 C
BSA104 Business Programming – 2007: Assignment 2
5 S6 g5 b7 O/ H. L& KPage 2 of 5. p3 b8 h; y! G) A7 E, i
b) Print out to the screen all the lines of code that are the same
* [; ?$ O9 L4 Z+ ?; Y' A* A Include the name of the file and the line number of the code being printed for each of the two files6 p& L6 s. v- ^. `9 n" L
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared; H0 f- M, r; @' F0 z$ [1 v
 the name, username and department of the user" x5 I# p8 C4 Q! d- Q& E
 the statistics of the comparison
0 `1 O5 J# I5 E$ i0 J2 W: E$ U- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different3 b( Q( O, M1 G4 d& \; q: w- x% [2 e
 the recommendation for further checking- }8 J) y; x0 m& D" G) O) p0 e
- 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
, L- Z( a2 D. u0 B7 R6 X the names of the two files compared( c7 Q7 V, m) j; ^! i
d) Leave the program (exit)
' T" M q) w. k: M- G3 u, FThe ProgramCompare class: (Total maximum 20 marks available)$ f0 D" u- |2 a# Y+ D6 x) B' 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); T' @7 A: S0 H" V9 |% ]) h% e; e1 W
a) provide an error message if the files are not found or there is a problem opening them
$ j) |: B* h8 O8 a& B% T/ d9 }b) compare each line of code0 _8 _( a2 [- u* `% ^) w: ^+ t
c) print out the lines that are the same
; O, K# S8 p1 g) \7 E0 ?7 {d) count the number of lines compared / lines the same
. J: T0 e' I* s7 P: fThe AuthorisedUsers class: (Total maximum 20 marks available)
% i6 J7 D) l& G0 V4 J3. 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)6 I! w1 Z6 [* C4 g
4. Provide methods to:
; O& D4 O! I9 v2 }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
7 s8 z: X( i2 @' ~: j4 e6 z; Vb) return the name of the authorised user0 ]0 `9 }) U! u' `' A
c) return the name of the department of the authorised user X8 h( M% e3 b& c# \
Individual Data (Maximum 20 marks available)
( k$ p1 f, F% c& y* _% ?2 J$ _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. I7 c* F: V: g7 T; R) e; T
Documentation (Maximum 10 marks available)' |' t7 x( W+ k1 F, J! W( r
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.
5 I A1 X- E0 _8 bBSA104 Business Programming – 2007: Assignment 27 ^* D: W7 r9 f# a+ }1 ^
Page 3 of 5 |
|