|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming" [4 \; ]& Y1 t q& t* u* u
Shanghai - 2007
. A* r4 o( y2 k7 H% l; KAssignment 2
" j) T' p% l8 h1 ]% J0 U' sDeadline 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)
8 z2 v+ f/ @" a9 k7 _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.
: C, R ]/ w% Z3 u. K1 r1 nThe staff must be able to:
@3 g, v+ p0 }1 o( {9 z# [ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.3 a+ s+ [2 j" w& j. W0 E
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. x1 s$ w# {2 T3 Q n6 r
 The interface should provide a menu so that the staff can:
: y& T9 S6 ~6 da) Enter the names of the two Java program files to be compared
: s0 Z7 p/ P- i4 L& _# A For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 y6 @6 B/ I$ M& R** 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)., Z* k, J1 c0 l! i! G3 i' H
BSA104 Business Programming – 2007: Assignment 28 C3 T* k- I) ^& s- I
Page 2 of 5
! N" v- o1 Q# L) Rb) Print out to the screen all the lines of code that are the same9 t! b: k, `8 Z' F3 x
 Include the name of the file and the line number of the code being printed for each of the two files9 D2 ?: C. o# A* M+ a
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; H' T" P) f8 C4 S" `4 p the name, username and department of the user
; h$ o. k* S$ o1 Y& i" D the statistics of the comparison) f6 Y$ V3 w. o5 n* f, z- L# Q
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 o* }2 H; V9 g6 D the recommendation for further checking
* D+ _1 n- {+ a6 o9 j5 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
! ?$ A D$ b1 U" t; p+ m( E" t" c the names of the two files compared. b& t3 ?; U9 i) b- v, n
d) Leave the program (exit)
& s) l2 `! D- C8 C9 sThe ProgramCompare class: (Total maximum 20 marks available)
. ]- D+ w) K- d2. 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)
* |! V: q2 @" da) provide an error message if the files are not found or there is a problem opening them
* o! V0 E& w( lb) compare each line of code( b/ L/ R) Z+ s9 } h+ Q
c) print out the lines that are the same6 R- m5 ~/ t% d& l
d) count the number of lines compared / lines the same; s% p/ [2 z& Q7 f
The AuthorisedUsers class: (Total maximum 20 marks available)& w) U8 B( a8 a6 w n
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)
! S9 T0 n1 N! ~' x& b4. Provide methods to:
+ s8 r) d2 m+ l6 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
# N+ K, _3 h2 _1 d$ \b) return the name of the authorised user
: [& G* v8 l$ g4 }) }# qc) return the name of the department of the authorised user& f/ O/ h% U- q5 }
Individual Data (Maximum 20 marks available)
0 S" T. m( u- G% z9 g& e, ~0 b5. 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.
1 \6 T0 v% w4 B WDocumentation (Maximum 10 marks available) _) Z' J2 Y+ _- J
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.! V: P% Y; b& |9 r# Q( n1 Y
BSA104 Business Programming – 2007: Assignment 2
4 t `8 A9 S2 [) v, o; ~Page 3 of 5 |
|