|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. f' u4 d& Y4 A
Shanghai - 2007/ o" j( V+ p+ b
Assignment 2( D- Z3 r4 b/ S! `8 _; u+ l" e! T* C" 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)
- f6 v0 p) E! b5 D9 |2 \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.4 v& g4 P$ p! Z- w0 {+ }6 z2 n
The staff must be able to: ~, C L2 u& K2 Y# \
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.: T& E! X: |* O% n& Y" b5 w0 S
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.
! O3 q2 x A% i- f: X7 M/ s+ y The interface should provide a menu so that the staff can:6 n+ ]' q& v9 [8 S( a" z
a) Enter the names of the two Java program files to be compared- H8 ?$ H7 X, t
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
: l* p' n+ Q$ [2 w! O1 k** 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).
+ l- J! m( J+ H; F2 \! p; v2 LBSA104 Business Programming – 2007: Assignment 2
1 r# y3 K! @. K1 r2 _Page 2 of 53 s5 i- ^& t l/ s
b) Print out to the screen all the lines of code that are the same/ w. Q# J+ Z7 u* U; |! q
 Include the name of the file and the line number of the code being printed for each of the two files. a/ J4 g) Z) q2 B
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
, i0 K0 G) \, Q- w& K+ ]+ E the name, username and department of the user
t7 c# R7 z [# ^/ X: ` the statistics of the comparison
* f+ t9 n! K( n" K2 C/ h [: k7 `- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different8 Z6 o c# c* _+ N2 e
 the recommendation for further checking: u3 {6 K# {0 r6 B
- 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/ l5 f- z6 I& d$ [3 K
 the names of the two files compared
$ E2 [+ i$ k* W6 id) Leave the program (exit)
% a4 @ r; h8 W8 z0 u1 J6 K) }. IThe ProgramCompare class: (Total maximum 20 marks available)
' {) j, l/ M8 X- P& P2. 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). o/ N# V8 k, Y( A
a) provide an error message if the files are not found or there is a problem opening them
9 w1 t0 M) q1 b' j% R: s& ^9 y/ [) ~b) compare each line of code
* n) l" F9 N; d( V& O+ ac) print out the lines that are the same
( R7 A+ l& t: o$ `6 |d) count the number of lines compared / lines the same
; }8 i7 V$ L' O( R+ RThe AuthorisedUsers class: (Total maximum 20 marks available)' e0 N2 c; U/ q/ M7 j7 V8 t
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 V5 d( {/ ~1 X+ i
4. Provide methods to:; ^7 _7 H' I/ N' A/ _
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
; B9 P2 K: _: K9 Rb) return the name of the authorised user9 ?; s. [5 @9 g
c) return the name of the department of the authorised user7 G r/ ^1 w0 X( e
Individual Data (Maximum 20 marks available)
8 M" j2 a& A4 D A5. 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 s0 W4 e9 c9 k+ d) s2 M
Documentation (Maximum 10 marks available)
8 I% O; y, `8 @5 N! x+ s m3 o, O4 z7 z6. 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.; i# T c6 w7 r* @" j# b- f- h, m7 W( p
BSA104 Business Programming – 2007: Assignment 2
: H7 H6 q& i7 s3 K) w. @Page 3 of 5 |
|