|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: x7 g6 }; }1 c2 T- H
Shanghai - 2007# z3 R9 z( n* s) @9 x% B% c
Assignment 26 I: J+ w+ m D* z$ o
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)- K- m5 ?! B ]0 B( u
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.+ P3 \0 P, n8 q
The staff must be able to:
) m" M y' d2 j( I Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.% F& m7 t0 y" m3 |
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.
& z _: `; {7 w u9 o The interface should provide a menu so that the staff can:6 T8 D1 H/ M9 w$ X/ l
a) Enter the names of the two Java program files to be compared
0 x- s$ W8 `& s, e$ p0 f& j For this assignment, it will be assumed that the two Java program files are in the same folder as your program.! K1 R$ n2 { p& y4 w( s
** 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).
$ q8 b. y. o" Q0 l Q, v- DBSA104 Business Programming – 2007: Assignment 2, G; X& R; \* u3 F, X5 @
Page 2 of 5
; c6 Y1 N q* V- Pb) Print out to the screen all the lines of code that are the same" K2 b+ y" i" U& H" Q0 m
 Include the name of the file and the line number of the code being printed for each of the two files
+ C9 e) K1 d) c" v9 hc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared. C3 d% t: n. P% ^6 f* J* M3 W
 the name, username and department of the user
+ }$ L* Z7 m' J( d7 F _' `3 D/ H the statistics of the comparison8 x# M$ Q, c& x( H; |4 G3 V
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different0 ^- C& P/ {( e7 G v/ o
 the recommendation for further checking
" Q8 t/ }- k' f* E- 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
( ?1 c# b) M7 g- P+ F4 M the names of the two files compared
0 m2 h. u( l8 u8 Y# A7 n- `d) Leave the program (exit)
$ y7 P1 [# ^6 y- u! jThe ProgramCompare class: (Total maximum 20 marks available)
6 U0 T7 s0 G- u/ }5 q8 w2. 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 v* U: _- K$ {$ O9 ga) provide an error message if the files are not found or there is a problem opening them! A4 b4 z& [* c% x5 C8 c; d
b) compare each line of code
( I) S) ~& Q, q J8 ?) z' i* Xc) print out the lines that are the same8 H/ ]# W* y2 o9 u
d) count the number of lines compared / lines the same
! g3 \$ U0 b( u2 `- N2 g. l; EThe AuthorisedUsers class: (Total maximum 20 marks available)
4 |& q3 k" Y& }+ G; X3 k; e* o+ V3. 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)
/ |% N6 T0 e$ T7 [! j% V# q& k4. Provide methods to:
8 w" i V+ L0 |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 match6 ?# Q R$ N F" P" N5 N1 K4 |
b) return the name of the authorised user" k0 c$ y* _# d3 @
c) return the name of the department of the authorised user
0 ]$ N5 v; R4 K" N7 O- C4 d$ oIndividual Data (Maximum 20 marks available)+ J0 u! F4 }9 X7 @. E7 w6 d( `
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.# M+ n U7 p1 Y/ B+ i$ P
Documentation (Maximum 10 marks available)% ]; v D+ V% U2 w+ q
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.) @, U# J) n9 I: Q- C2 G: a0 u
BSA104 Business Programming – 2007: Assignment 27 _& n% i! j* _5 K K: A
Page 3 of 5 |
|