|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
, l/ B5 y2 F" M* ]+ [& ~Shanghai - 2007
8 [% E+ S+ [! E1 l- uAssignment 2& u: m( r1 O- D; [
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)
* L5 F) D# A2 b6 x5 G1. 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.
% E d- d4 g+ i- J) k7 `The staff must be able to:4 t- S3 f' T' m5 r' c
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 U% O! ]3 p( c# H1. 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.) A. W s3 J1 I% }9 l1 u
 The interface should provide a menu so that the staff can:
. c D, t1 l; t1 na) Enter the names of the two Java program files to be compared
: ^! r0 n; Q! c- K' Q- F; ~! k For this assignment, it will be assumed that the two Java program files are in the same folder as your program.& [' I# J4 O5 z2 @. V3 A$ n3 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).
1 p- E% N4 }5 T3 K2 Z( @6 eBSA104 Business Programming – 2007: Assignment 2! B4 Q% p8 O! n# f
Page 2 of 5; {8 M8 f( T# E: m
b) Print out to the screen all the lines of code that are the same1 i }! Q- u1 L$ ~
 Include the name of the file and the line number of the code being printed for each of the two files4 [. i& Q5 o q
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
* h2 N- e4 s8 U0 g the name, username and department of the user
7 c+ _; e1 {6 O! T" O6 R1 a the statistics of the comparison: W; t4 L7 f* r9 D H6 e
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different* _8 E$ w& V+ c
 the recommendation for further checking6 X. U& r t9 h! h+ V7 I+ s
- 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
' ]3 L! v0 O- M! k6 K the names of the two files compared
: v# i' E9 }% `! l$ ~d) Leave the program (exit)
, W7 i, \0 Y% a8 ~0 fThe ProgramCompare class: (Total maximum 20 marks available)
, A* I8 U' h* \5 @/ h# y$ H2. 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)
% L: |. _, q1 q- I4 r9 ]a) provide an error message if the files are not found or there is a problem opening them
3 i/ j. ]/ S& c; ^b) compare each line of code
$ X3 h0 k2 Z S3 A( Gc) print out the lines that are the same5 @& b- Z! ~- f: `- J4 M$ a
d) count the number of lines compared / lines the same2 G+ k2 M7 ~3 |* J( s6 n0 e
The AuthorisedUsers class: (Total maximum 20 marks available)
" e* X0 s+ y' y1 O% A/ R: `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)
; Q3 M% H1 h* o8 D! A7 k& ^4. Provide methods to:
1 {$ i* o* D* Ea) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match7 n5 w* P( u; r" o9 q' K7 L
b) return the name of the authorised user) U1 D" H; Z8 N# u3 A% c% d* [, }
c) return the name of the department of the authorised user
9 y1 ~, ]& J0 eIndividual Data (Maximum 20 marks available) j6 `0 X. Z& }' P4 C# z3 V
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.# F6 G8 E1 y* J* A9 p. B# K9 F
Documentation (Maximum 10 marks available)
+ _+ D6 _* D; Q ]9 T6 h& \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.
3 D- S+ R/ W* C, [$ b1 S2 R CBSA104 Business Programming – 2007: Assignment 21 E9 u: N" l7 }2 R% N# q
Page 3 of 5 |
|