|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming' b9 O0 A# q9 }6 P$ W9 `) u% {
Shanghai - 2007
6 R& \0 _" I: k8 j+ nAssignment 27 T8 T; f1 ~- @" D9 p3 \. P
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)
6 R; O+ u& p o) c6 E5 a2 K1 O$ v1. 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.! B: Q, P6 K# p( ~
The staff must be able to:5 o: X' D9 Z! r$ B0 F- Y9 Q
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
" E/ p( |7 B/ C+ f, Q/ n+ X) C- w1. 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.
9 g2 K$ Q: y e; G" N2 `) Q The interface should provide a menu so that the staff can:
7 B$ C0 W. R; ]" pa) Enter the names of the two Java program files to be compared
. Q* Z4 d$ U- j9 J" o8 c3 d5 _ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 i0 ]; ?6 L v2 S. k, W8 j: v9 ?
** 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).
: ^6 J% u0 y3 n, `BSA104 Business Programming – 2007: Assignment 2
! _4 J( M$ N& D2 ]Page 2 of 5: s( V& j5 Q8 \4 l. D
b) Print out to the screen all the lines of code that are the same
' h) ~5 n; r2 b+ \& e+ D: h! B Include the name of the file and the line number of the code being printed for each of the two files
4 r4 }1 [- ~: \8 w) B/ {% pc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared$ l+ d9 l# ]/ O( z9 a" m: X4 D
 the name, username and department of the user+ M/ y* a) ?& P) o0 {
 the statistics of the comparison
$ l3 V" M! c5 H6 Y- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different; E/ n, u0 P4 O! q5 h# d: D6 N2 `
 the recommendation for further checking6 K N- ~. p& j5 m0 P
- 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
2 U2 @0 c# n. `2 ^# ~ the names of the two files compared9 m* ^# t, X& l" o
d) Leave the program (exit)
1 N/ \) \9 j5 R2 s8 s# aThe ProgramCompare class: (Total maximum 20 marks available)) `6 p1 s# C9 z5 u5 f
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)
/ {6 k2 B9 N: m& N# w" wa) provide an error message if the files are not found or there is a problem opening them$ _4 M- ^9 `4 l8 w
b) compare each line of code
7 [ }0 A) K- z1 W. [" ec) print out the lines that are the same- I3 o* A" c' ?1 q, F
d) count the number of lines compared / lines the same
; T9 k8 e* ^8 wThe AuthorisedUsers class: (Total maximum 20 marks available)
# u; ]" Y& u4 `0 y2 ~' o3. 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)5 z3 T! \+ b5 k) ~
4. Provide methods to:- S# J: v$ m& 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 match0 K! i) y3 O) j/ v3 @; x8 @, h4 f8 O- d
b) return the name of the authorised user! \4 I {: ^9 H1 g' u
c) return the name of the department of the authorised user1 D" A4 R# y/ m. u* b: v$ n
Individual Data (Maximum 20 marks available)
- {8 ]( R' s0 _; G5. 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.
8 e5 D9 l2 B# U* ^4 wDocumentation (Maximum 10 marks available)1 J! S6 l7 p, K
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.
% \. h5 m' y! ]" q RBSA104 Business Programming – 2007: Assignment 2
I. Q7 s; p1 w8 kPage 3 of 5 |
|