|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming) h9 G q1 ?$ C4 i
Shanghai - 2007
q0 B) r) R9 }5 Y& }Assignment 22 o" X8 L. R! a q" {
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)
. c9 y L' N" i6 h& c) S3 W1. 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.
$ z. |# _& y& f! @0 T2 _6 ~9 @The staff must be able to:
* A5 b# G( C, m Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.$ C c7 n; W+ T
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.
5 v# v# a" ?- c3 @6 @2 e- i The interface should provide a menu so that the staff can:
3 r3 P' _' q+ N. |. s7 j" na) Enter the names of the two Java program files to be compared! ] {1 s; l- f
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: R' W% x5 C. a' y% P& ], I1 o7 ~
** 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).
- ^( Y3 u( g5 @$ gBSA104 Business Programming – 2007: Assignment 25 |' ~2 T$ d8 T+ D( M& Y4 Z& Y+ e
Page 2 of 5' b# R3 k& m3 `1 U
b) Print out to the screen all the lines of code that are the same
1 W" e- H; h, h i( h; k Include the name of the file and the line number of the code being printed for each of the two files
5 X& E7 I0 R* J6 ?8 Gc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
3 t' _7 k6 k3 \; z$ q! C" N$ a4 ^ the name, username and department of the user
# T. I1 W. p- L; l6 f the statistics of the comparison
5 }- P( p' x1 H$ y- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, R. k0 y* a$ X9 B the recommendation for further checking% [1 `4 R6 o6 k0 z* _9 ^7 ^1 c
- 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 closely8 Y7 g/ E9 d7 y9 L4 [
 the names of the two files compared$ m- h: ?9 |7 a3 a! g) P0 n: S1 y' W
d) Leave the program (exit): T5 ^" t0 \- X* i' Z
The ProgramCompare class: (Total maximum 20 marks available)3 R2 F5 Y: T& A3 ~4 W
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)1 D% l4 M4 [9 L: l
a) provide an error message if the files are not found or there is a problem opening them
! D1 t) G3 z7 M9 Cb) compare each line of code7 g( A- I1 S) {+ H+ s5 C
c) print out the lines that are the same# K7 Y4 ~# C" P# J; h8 [
d) count the number of lines compared / lines the same/ s( ~* H# e J$ P
The AuthorisedUsers class: (Total maximum 20 marks available). _ b$ n. M; N# |+ n- c1 \
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)
# ?5 i& R8 L1 z/ |' l; ~4. Provide methods to:
6 E9 a6 S3 U G& ]% Xa) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match8 J( x) Q; g c
b) return the name of the authorised user
# C* Q' \0 |! }- qc) return the name of the department of the authorised user9 U9 A0 k! D0 M6 a
Individual Data (Maximum 20 marks available)
* a" P. {6 g, Y* Q% d9 u2 G4 w. P5. 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.4 e. ] Z1 q: K. u! t
Documentation (Maximum 10 marks available)4 W. B0 m' N" f- A1 M( {7 t1 {# w
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.7 ~" n. n2 a! a2 A/ k/ m
BSA104 Business Programming – 2007: Assignment 2
# r3 I+ R) C8 L6 m% _( tPage 3 of 5 |
|