|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
, ?8 r- Z) J$ KShanghai - 2007
$ V4 l- n1 C% s4 p& mAssignment 2; o q( o$ d8 N/ m( h' c/ `
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)3 B4 J: d7 P& {
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.
# b0 x ^) `" bThe staff must be able to:* _1 [3 {4 y! V! L
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
# A& |. l" D! q% _3 e- y1 \% s; O1. 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.
/ H! c" I+ m# L5 ]4 z The interface should provide a menu so that the staff can:' C& R7 c ?( K" L; i- n8 H4 a
a) Enter the names of the two Java program files to be compared
5 D- F; d, T+ c( } For this assignment, it will be assumed that the two Java program files are in the same folder as your program.+ Y7 D9 W% {' O4 O7 } E
** 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).9 U+ J Z- W! O; i$ k5 _' ^
BSA104 Business Programming – 2007: Assignment 2$ ^1 c' s- a7 G3 U0 d0 ~
Page 2 of 5
) b2 Q6 z) `1 n" `% ?9 y ]" y* Tb) Print out to the screen all the lines of code that are the same6 v& n2 a' j' q) c/ U+ G4 L$ |
 Include the name of the file and the line number of the code being printed for each of the two files9 `+ E2 G2 J2 ^
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
+ n7 b+ I/ l$ _1 \* I3 t the name, username and department of the user
* u8 t+ O, U/ o5 [4 t+ X! B9 R s1 L the statistics of the comparison
7 Y; `; W, F* g+ Z- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
" t1 e0 J9 A* S8 [! r7 `- y+ T' l7 f$ } the recommendation for further checking
5 h, r+ F P: r# W3 H- 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 closely5 e0 V R+ W7 ^; u
 the names of the two files compared
/ t* x2 n2 W. w" Q; ^4 cd) Leave the program (exit)
1 V$ v1 x4 J0 U# F3 m# w( @The ProgramCompare class: (Total maximum 20 marks available)
% u/ w& ?" a7 B9 B% }4 f3 e, u4 g2. 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)/ J3 X" O; i: ~& o) |
a) provide an error message if the files are not found or there is a problem opening them
- V& `# \/ O* fb) compare each line of code5 ^. d4 d) s, v: q, \* G
c) print out the lines that are the same* @( K4 U% \! r* J+ o) X2 d
d) count the number of lines compared / lines the same
3 M; X# d( t. z& q7 |, oThe AuthorisedUsers class: (Total maximum 20 marks available)
4 k J% z' ?9 W- h8 ]$ X9 v! ?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)
% ]/ r( }5 Z( f3 ?4. Provide methods to:& ?$ o6 Z4 @0 X8 g O
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
+ O3 B1 L: P& A0 C7 Sb) return the name of the authorised user4 f+ a$ q: m% I: C
c) return the name of the department of the authorised user; n$ C, D3 {; p5 ~; G4 Y& q
Individual Data (Maximum 20 marks available)
# O& @0 q1 W: h0 b% Y5. 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.
6 B1 n0 y! e8 M' C$ a+ R, ]- ]8 A( @Documentation (Maximum 10 marks available)+ B; t7 @. }3 a; A- {* D+ ^
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.- Q$ Y$ L# d$ ]7 o }7 v* s
BSA104 Business Programming – 2007: Assignment 2
/ `/ U Q9 j$ n# u# C5 q4 wPage 3 of 5 |
|