|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming2 |6 j( y: K' C; N
Shanghai - 2007 v9 U( z ]" {$ \% _: _9 S
Assignment 20 i, q* Z* K0 ]
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), ^7 b+ S3 y2 u- S
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.
) H, E! I- ^2 E, i* D, w( PThe staff must be able to:5 [- W. j$ [* v) P) Y% e
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! Z8 w, t0 k a. b. a6 C. T1. 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.( b) G& x! Q. F% l' D
 The interface should provide a menu so that the staff can:
0 ]% I: o! O6 R" ]6 S6 F ?a) Enter the names of the two Java program files to be compared
# r, e# w0 c2 ]" @9 _& C5 ^ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
$ r6 J' f7 ]" K }** 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).* |( e, z- Z1 ^3 v2 E
BSA104 Business Programming – 2007: Assignment 2- R2 D1 h) A/ ] k# H
Page 2 of 5
) S$ h+ t4 `+ m0 b+ Lb) Print out to the screen all the lines of code that are the same# I$ ~8 f% _1 x/ Q3 F
 Include the name of the file and the line number of the code being printed for each of the two files
# e$ h" U& g5 c% B/ _, sc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared+ p# O4 ?& {6 l; @
 the name, username and department of the user
+ c9 {1 i4 O8 x2 w9 D the statistics of the comparison
" Y# s8 S7 {# F! e3 r- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, v: E0 j1 P, ?' K the recommendation for further checking9 V" D& ~( H. f/ f* f# _! 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 closely
; G F. c. v& m* q the names of the two files compared
# t2 o. a1 T7 P' h7 Id) Leave the program (exit)
# }% F w7 B5 M8 c( R: N9 rThe ProgramCompare class: (Total maximum 20 marks available)0 @8 b2 {( ^( K4 C( M! S, A4 w( X
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)
/ H0 z/ l/ [) q9 x) |' da) provide an error message if the files are not found or there is a problem opening them
2 }7 K, B- }# w4 \5 i! Z# Tb) compare each line of code
. }; H8 E9 \% S. Y. p$ |c) print out the lines that are the same
/ R+ }- Z9 h4 e$ v! n) @d) count the number of lines compared / lines the same
; }- [4 X5 [. @( | JThe AuthorisedUsers class: (Total maximum 20 marks available)2 {3 x& j& m) F3 r! O1 k. Q7 ~
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)5 e$ l! _, K4 K! ?
4. Provide methods to:. O: Y) H$ C% E* `0 S5 c. K1 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
# d: Q. f( `* }1 k# a( _1 Hb) return the name of the authorised user
: Z5 v# O0 J' E& Dc) return the name of the department of the authorised user
/ ~* a3 j3 j2 C) o8 FIndividual Data (Maximum 20 marks available)6 {$ S* V9 `. M8 W
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 N2 z3 {2 d. I9 y, b
Documentation (Maximum 10 marks available)
' y8 p# S1 f* E3 O8 b, ~# f6. 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.
7 l/ F/ |8 k" S: v# a% s* b" mBSA104 Business Programming – 2007: Assignment 2
& I( A2 q4 U. p! q7 j3 C {Page 3 of 5 |
|