|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
) m" ^! j. t% d# N1 N3 D( cShanghai - 2007
4 |/ _* g, ?5 i5 O! k! aAssignment 2% m: S' q0 I! K+ b7 s6 q$ ^% e
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): E' G4 k0 Z! b! }" U2 b
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.7 z: r7 z# x; X0 w- T/ c
The staff must be able to:: l! M4 S: p0 H9 U2 U/ u
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
R, I1 e$ S* H$ N; y8 }0 C1. 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.
* `0 f$ u3 }. t The interface should provide a menu so that the staff can:
( p W# f+ W4 u, U- x0 a# G6 ra) Enter the names of the two Java program files to be compared
% I3 W9 }' {. O5 s7 e+ }+ Q+ s. Z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.$ t2 B0 [) Y+ C3 N, W# W
** 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).0 f% s( h+ Q" c! Q
BSA104 Business Programming – 2007: Assignment 20 {0 _+ D% {2 x+ p3 f6 Z( s& j4 q' G
Page 2 of 52 Q, K- S% t5 B7 @' c$ E
b) Print out to the screen all the lines of code that are the same
* Q' A6 Q1 l$ e6 i: r7 v Include the name of the file and the line number of the code being printed for each of the two files
: E4 T- o9 {( @* pc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared% F4 A/ q7 K$ h1 u R4 N
 the name, username and department of the user
! m! |1 l5 h8 F the statistics of the comparison
& X; b) P2 r3 P9 c- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
1 {( z% r# o2 j0 \ the recommendation for further checking
* k$ S( q/ h C4 b! }# g3 w- 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
: n+ D6 @% l* ]* p' K( V the names of the two files compared
5 Z3 P! ]/ b3 r3 Q5 fd) Leave the program (exit)8 E& z* G3 w* Q$ ^1 b) i& r
The ProgramCompare class: (Total maximum 20 marks available)
7 B' v1 U8 n2 A; C0 j2. 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)
) @, K/ w3 `! pa) provide an error message if the files are not found or there is a problem opening them
( s* J- E: E" ] w0 i( h8 F5 ab) compare each line of code
1 }* J1 D' V! J% oc) print out the lines that are the same
* X/ i6 C1 F, C4 C$ x1 z" ld) count the number of lines compared / lines the same
3 c% X+ A. i2 O: J! ?The AuthorisedUsers class: (Total maximum 20 marks available)4 N" T" y- J+ P7 K* p; d" D: X
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)
+ u' [& `9 T5 m" \5 b4. Provide methods to: W" M y& ]0 Q& 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+ Q/ W! F8 Y& [$ F6 g, G8 m
b) return the name of the authorised user% O5 T4 P3 ?* h" U* O% L1 `
c) return the name of the department of the authorised user
1 |& R' u/ o: y% c, u( z) N; p" GIndividual Data (Maximum 20 marks available)
5 @" c- d7 s5 ~( j0 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 n. n/ K. I+ U( t) n1 eDocumentation (Maximum 10 marks available)
1 u' _! J" K6 [& k" J6. 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.& t: J# h$ ~- r
BSA104 Business Programming – 2007: Assignment 2' t8 T- M0 g% q8 _8 k/ }
Page 3 of 5 |
|