|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
" V7 ?; r6 T: \3 BShanghai - 2007' F. ]8 ?2 p& J% L; @
Assignment 2
F: Y) o5 Y& r) h3 V1 jDeadline 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)
9 H7 S5 S% Q- t' w5 Q3 t1. 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.
/ q: [+ Z; h' C$ T2 A8 `The staff must be able to:& s) W: c- G- q' y/ u. q0 N! ^- R
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.' L& B h* d6 ~
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.9 G1 ]2 m' m2 y E( L: G0 q
 The interface should provide a menu so that the staff can:
% N# j, ~' C4 F; T- `8 m0 ja) Enter the names of the two Java program files to be compared
# R; g* _$ m6 [7 ~" t& i0 w8 h For this assignment, it will be assumed that the two Java program files are in the same folder as your program.% y; W1 Y: `0 c& x3 N
** 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).# t. S+ O3 p9 z% g x9 g
BSA104 Business Programming – 2007: Assignment 2
9 q% P+ L& l/ cPage 2 of 5. w( P, B8 E, n( m5 `, X$ Y3 J
b) Print out to the screen all the lines of code that are the same
8 A3 Q- R6 M0 |5 w Include the name of the file and the line number of the code being printed for each of the two files
+ Y; o3 ^+ h& yc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared2 w0 R; M; H* |. J! T. ?
 the name, username and department of the user
" }% O% r1 C+ c; R the statistics of the comparison
9 `( h9 I1 r' Y) o- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
5 i9 j+ s/ ]' x: x( @/ P2 A the recommendation for further checking. I+ M s. ]3 U; V% z# Q' {# C
- 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
! |0 s& S, b0 _- g: v the names of the two files compared
) R8 l% ^: U o% jd) Leave the program (exit)
! X0 j E' u( B9 IThe ProgramCompare class: (Total maximum 20 marks available)
6 i# s. A5 b" L/ x: G: Z2. 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% y- R( T v$ Fa) provide an error message if the files are not found or there is a problem opening them. }( J* H/ V) G O$ \2 R8 T: G
b) compare each line of code
5 T/ Q5 K5 t) D* L! ?& Y0 Tc) print out the lines that are the same. N, X4 p& M/ f% w l/ r% z
d) count the number of lines compared / lines the same3 N0 D: s2 Y: O% E4 W! v0 Y
The AuthorisedUsers class: (Total maximum 20 marks available); h4 T, E/ s: Y7 o
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)! a9 z3 r' Y9 D6 L# v7 u
4. Provide methods to:
* t q! |& _( \; ]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$ G$ `7 m4 [7 e
b) return the name of the authorised user
" o! D& r& W4 ]% nc) return the name of the department of the authorised user
. P. ?$ c+ L7 m; g# d- LIndividual Data (Maximum 20 marks available)
/ a8 d+ o3 f' i$ U- g; b0 P, @: f3 P5. 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.0 Y) h9 a6 i6 y
Documentation (Maximum 10 marks available)) r5 P0 v# V4 ?6 s, |! Y
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.
) G/ \( S6 \$ e' IBSA104 Business Programming – 2007: Assignment 2
! E! i* e2 ^, [Page 3 of 5 |
|