|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming" y9 S% V9 m1 g+ k! C, Z+ W
Shanghai - 20071 K; Y' Q" O* m! ^
Assignment 22 O5 F( M2 @) j5 O3 ?% L' q/ H
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)
, o# W L* z- z1 v: i1. 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.
8 t) Q) T$ W5 d9 ?* P1 uThe staff must be able to:
) K/ y) P- K1 a' \6 _/ `/ j# o Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
& k5 o3 @! }' t. l1. 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." f; d- ?; q4 f+ H: D" |7 k
 The interface should provide a menu so that the staff can:/ m: [- d- v1 y4 y/ T8 c9 N5 O6 f
a) Enter the names of the two Java program files to be compared
1 |8 x* i B( D2 N; C/ s# H* Z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.3 k% n5 O) e$ V, E
** 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).; F0 S7 @% ?. y1 R
BSA104 Business Programming – 2007: Assignment 2! U$ ?# C9 U. i8 s
Page 2 of 5/ S1 @3 {; Q/ A
b) Print out to the screen all the lines of code that are the same
0 N2 M- r7 l4 a1 m+ Y- [ p Include the name of the file and the line number of the code being printed for each of the two files) X- V" `! E; D3 L( b% I
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared. T; A" F# Z$ M
 the name, username and department of the user
3 M- r- g2 l6 | the statistics of the comparison/ N; W0 ?2 O N* v5 n7 a2 }2 u% H2 v" O
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ w; Q$ M2 u7 x W H' J the recommendation for further checking2 \/ U7 ^% j! 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$ a- m1 D$ g1 M4 {+ D" Q6 q
 the names of the two files compared" O% Y$ ?" v1 D! J; V- U3 Q! U
d) Leave the program (exit)
( h( q+ v0 \' h/ DThe ProgramCompare class: (Total maximum 20 marks available)
' |8 S: Y, \# p3 g7 m2. 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)- q5 l1 c9 A. Z
a) provide an error message if the files are not found or there is a problem opening them
! D8 \# L% A# t$ \, k: j' Cb) compare each line of code% S d: I: l+ k* Z
c) print out the lines that are the same; e) H2 E q: q; Z0 a
d) count the number of lines compared / lines the same: @' q Z* L( z% R5 |4 S- e
The AuthorisedUsers class: (Total maximum 20 marks available)+ g2 K, X6 [0 S6 d; |
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)
) G8 \5 j- e3 A, K, ~0 ?4. Provide methods to:
" ?: I6 i+ i8 Sa) 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" q) h2 o: }/ T
b) return the name of the authorised user$ P6 V1 T. Z* N8 E8 X6 K
c) return the name of the department of the authorised user
8 s$ F V5 s2 `2 ^5 t. v% x# [" D. ?) `Individual Data (Maximum 20 marks available)4 F& M6 I% l4 C+ q, G0 i
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.
% B8 o7 e& v$ g7 s, MDocumentation (Maximum 10 marks available)4 A0 I7 J8 M4 u# b$ M1 V# l
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.# p9 F* z9 ~6 F8 i+ W2 A- f" ^
BSA104 Business Programming – 2007: Assignment 27 c2 q+ K1 @2 _
Page 3 of 5 |
|