|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming0 K0 w- j2 ?3 [8 H; I" n& H: G
Shanghai - 2007
" L0 F( ?$ E2 i$ I# L: C$ gAssignment 2
0 x' Q$ x0 M& b+ @7 UDeadline 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)- \5 x, Z. w' J& G5 ^
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.
, t$ F% h8 i" N. J MThe staff must be able to:, {1 Y6 j3 W. D' N. p% }
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
1 [% J2 Z ]0 \' a1. 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.1 J" [" Z% ~% m* V
 The interface should provide a menu so that the staff can:/ \% r! ]" T( k: t4 |* ~
a) Enter the names of the two Java program files to be compared
: P1 L, P m I- L( _8 z% P For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
& }+ u {9 u8 j3 Z8 y** 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).) C$ w) k3 a) D. s; |$ A
BSA104 Business Programming – 2007: Assignment 26 V3 }" t* k( N$ H& `- F* d, Q9 ~
Page 2 of 50 A3 q$ f8 `9 ~
b) Print out to the screen all the lines of code that are the same
: k3 @6 M( A& X Include the name of the file and the line number of the code being printed for each of the two files4 ?5 Q! z5 G; Z4 b0 R- x- |
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared; E% \% R8 {3 I% E+ G; a
 the name, username and department of the user8 Z) m7 ?, c' T
 the statistics of the comparison; j Q; R# n* r. q6 N* Q# r) b% ~4 |
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
* S0 P% F7 V+ i! K% l the recommendation for further checking4 U. n. y: M2 A8 }& y; A3 y
- 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& B8 i; X2 j# q' @& _! D3 \
 the names of the two files compared
: c4 [# k$ a- n; w$ k3 ?$ H6 n8 \d) Leave the program (exit)0 @/ J. X/ K3 F E
The ProgramCompare class: (Total maximum 20 marks available)* H6 v( H: l8 O7 T( ~
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)
* M; I7 n, _+ {a) provide an error message if the files are not found or there is a problem opening them9 s; ?5 x" p2 r+ b2 X/ q
b) compare each line of code4 H" x" K. O4 ~/ v+ G
c) print out the lines that are the same
$ ]0 u X: f( G. a/ q2 i6 C6 |" ~d) count the number of lines compared / lines the same
/ J, A9 b$ S$ w" X* b& YThe AuthorisedUsers class: (Total maximum 20 marks available)) S5 t/ d$ D& b3 Q6 ^7 h$ C
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)
/ Z/ @/ N( Q, B- y3 L% |4. Provide methods to:3 T# O& O6 \+ f9 B! `. ~7 X; y, K
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$ R. `# q% p- p; X
b) return the name of the authorised user4 G C' O% |! F: L2 L; S' n
c) return the name of the department of the authorised user
2 M( x) n- D4 C2 R- o! ~Individual Data (Maximum 20 marks available)" K6 H3 Z2 q; F' Q
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.' c& x! [! }2 i4 M# c
Documentation (Maximum 10 marks available)& o. b2 C* m" Z! X/ `
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.- N Y' K" A, e8 M) B$ p8 u$ v$ Y3 ]
BSA104 Business Programming – 2007: Assignment 2
4 z. |, r+ |2 g) xPage 3 of 5 |
|