|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
. K; b6 W8 _' e/ L h! u. jShanghai - 2007
+ g a8 x: U3 g/ l$ Q% NAssignment 2
1 a! o# R9 F/ L8 m( KDeadline 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)% i3 ?$ z, K+ s' L9 ]/ @7 j
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 i- c9 T. v! Y& h/ e
The staff must be able to:# X4 k+ b+ |# m; E
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
9 {4 u7 k* s: M( }5 i% |9 |. m1. 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.
" d8 m( }0 g# d; q The interface should provide a menu so that the staff can:
# H7 {- K7 K( Oa) Enter the names of the two Java program files to be compared
4 z3 K: n- i: ~9 z4 S" u' p$ E For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 ^3 W* y! ~3 ~2 w; n) V
** 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+ ~5 P# p, B. t8 SBSA104 Business Programming – 2007: Assignment 27 R* ~& k7 _! q
Page 2 of 5
" t' K& i) I6 T" A" L9 T5 rb) Print out to the screen all the lines of code that are the same
/ P7 F* P- @: v5 n6 J Include the name of the file and the line number of the code being printed for each of the two files- P: J- d9 e' `& G) b$ u
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 M9 h9 b- c7 E the name, username and department of the user+ B0 [) f* I7 f' b# H9 F! N' a
 the statistics of the comparison+ K; A: w u! ?9 f8 i
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' r+ z) t" R) T' O8 v# } the recommendation for further checking7 I& L1 R" u8 i
- 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 @+ c; H5 O0 _ the names of the two files compared
+ W' T/ a! O, Z. y* ^% ed) Leave the program (exit)
* A5 ^7 T! h3 q! D% R3 j7 t1 mThe ProgramCompare class: (Total maximum 20 marks available)+ D" H; u4 `1 K Q5 Y
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)
! D( y$ s6 Z4 x4 d$ `a) provide an error message if the files are not found or there is a problem opening them
' y9 A3 l4 Z; mb) compare each line of code
3 q! O l6 ?) A6 M) [c) print out the lines that are the same8 p6 l' n/ `5 S. a5 S% L9 |
d) count the number of lines compared / lines the same
: y+ n- ~& i& k( u& LThe AuthorisedUsers class: (Total maximum 20 marks available)
8 E9 Y/ n% D) Z0 u1 ?4 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)
4 X1 n. P; L+ C( d) @* ~4. Provide methods to:
1 i9 |" M+ K. q4 k4 Aa) 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
" C6 b3 k+ B& i" _; Zb) return the name of the authorised user" [2 r9 X. w6 u k
c) return the name of the department of the authorised user5 O3 `, \- ^ W$ N' L
Individual Data (Maximum 20 marks available)5 {% W4 e, O/ m" `. a0 o+ B( S( p
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 o* f6 |: Y% W$ mDocumentation (Maximum 10 marks available)
# I& i+ c: H5 e6 j' T9 H" ~! v- \ ^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.- {, W* y+ Q+ F' W% a
BSA104 Business Programming – 2007: Assignment 2
0 k% F) ^5 g3 o$ }$ q {Page 3 of 5 |
|