|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
6 y: G2 A% K+ H! D1 ?5 u, jShanghai - 2007% J8 D( ^1 P% @9 r1 x
Assignment 2
* {' Z8 k, J" W- a7 J! r7 |8 bDeadline 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)
: O6 i+ l/ ?3 k9 c1. 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.* e' \3 W( i/ I- g8 s
The staff must be able to:
+ H4 L3 m* Q- }! e( d Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.$ Q+ c. C, U& A, f2 c. i$ u
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.& g5 p; x) v3 O* c& K7 J' W
 The interface should provide a menu so that the staff can:
% n2 \& K) p; O4 v% Ya) Enter the names of the two Java program files to be compared6 p, A" r1 B+ T% M" G
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
- P7 r5 s8 l8 l; {** 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).
( I. S& n: |* S1 P8 u4 oBSA104 Business Programming – 2007: Assignment 2
4 R: X# c/ E" ?7 J# R9 H) NPage 2 of 5
# i6 J4 Z* O: k# B$ jb) Print out to the screen all the lines of code that are the same% O( d, l( `% d5 U
 Include the name of the file and the line number of the code being printed for each of the two files
2 e2 Q* X; m) }c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 L Z- f& \/ V4 n4 Z the name, username and department of the user4 `* [8 P" s& j
 the statistics of the comparison0 \3 c* a* E6 q& R$ M# c, ?
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
" z/ K; ~/ d% K% D9 \: B9 ^ the recommendation for further checking
# D3 ^% z9 f' i# Z2 a" B e- 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 closely2 y _8 f( F5 e: ^( E% }' d1 r# }
 the names of the two files compared
. T5 N$ J6 r0 \d) Leave the program (exit): ]$ L& V8 ?7 A. o9 w8 {" P! S0 J
The ProgramCompare class: (Total maximum 20 marks available)7 O, \9 d# d( n- s9 W/ K5 o$ l9 {
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)
0 k( u {! p% K5 fa) provide an error message if the files are not found or there is a problem opening them/ L4 [1 U) g$ a* Q& n
b) compare each line of code* F' K" ~/ i! }9 W% t
c) print out the lines that are the same; }2 l1 i( @6 J& n' n
d) count the number of lines compared / lines the same
0 ]; i- I; C) ], |$ @/ qThe AuthorisedUsers class: (Total maximum 20 marks available)
, e* m5 B& X9 x$ 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)3 r4 U% q4 C: J( M6 c$ t4 ^9 M! e
4. Provide methods to:
4 r& e# p' X) V" T1 b1 m; X/ }0 Ea) 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
( n1 S6 o# E7 c4 O' ^4 |! kb) return the name of the authorised user0 i8 u! A& x, A2 ~5 Z3 }8 o
c) return the name of the department of the authorised user& q# x" b+ ` f) x4 L. t0 n" T
Individual Data (Maximum 20 marks available)% x+ x6 M" n8 L* B1 d0 I
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.3 S6 A" ? D. ^& m+ P$ K2 D
Documentation (Maximum 10 marks available)$ S( @+ j/ \ V; z" ^
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.
, X K6 B1 k& L) d1 [" e% r* D4 bBSA104 Business Programming – 2007: Assignment 2( P4 Z+ n$ e4 \1 w# w/ E4 O; r
Page 3 of 5 |
|