|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming% C* j! `6 _* {/ e
Shanghai - 2007
4 F, I# D/ t/ L. r }' s/ e, FAssignment 29 ]& f0 m" |' O6 |9 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)
5 p. C6 f! F% c( P1. 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.& ^' E* N8 d; w/ o7 {+ S+ J0 A
The staff must be able to:( r! n0 O6 O0 Q. P7 w
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
: p9 K1 D+ t8 k/ w) `6 q1. 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.+ w7 O" q/ n3 k# K* x
 The interface should provide a menu so that the staff can:
) O6 Z: A& o" Ia) Enter the names of the two Java program files to be compared
1 y0 d0 y+ F7 y2 j4 W9 v: ? For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 p& y( g+ x, n; W9 v; j- ]0 P' \! K. Z
** 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).
9 _ ]3 m, m' P7 Y% P8 b8 @( UBSA104 Business Programming – 2007: Assignment 2
( J3 R+ F% x3 _8 FPage 2 of 59 Z, O2 v& H* ^1 f
b) Print out to the screen all the lines of code that are the same
8 n7 I4 q8 E# G. @4 g. I Include the name of the file and the line number of the code being printed for each of the two files
; q0 o) b' ^9 _) L. I: [c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
0 H: y5 B! @+ L% d/ u# K the name, username and department of the user
& p$ Z" T4 {4 U1 A* W2 j3 Q$ m/ B: q the statistics of the comparison1 S% s: T/ J5 w# B; {: S) `+ ~1 t5 {2 F
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
( @1 t+ V) y5 g) u- Z2 n the recommendation for further checking
$ W. u5 f ?' G. x$ V' I/ U- 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% G: y; p6 l) I2 P' d* @' h% _5 q
 the names of the two files compared
. F5 W4 d9 a2 b# V" R) Fd) Leave the program (exit)" l8 `# C( k" V8 b) m+ n2 \
The ProgramCompare class: (Total maximum 20 marks available)* s3 @# m2 Y ]0 [8 P0 X
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)
! ~4 x, I6 r" F0 [a) provide an error message if the files are not found or there is a problem opening them Q$ @ c0 F3 m* K1 G
b) compare each line of code) t. N0 p& A, Q) y/ W
c) print out the lines that are the same
: Z) q" l2 ]4 F7 ]8 A* h7 }d) count the number of lines compared / lines the same9 T$ C/ _. C d0 @
The AuthorisedUsers class: (Total maximum 20 marks available)1 N: D4 I1 [8 @; M
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)
1 W- q. w X2 ~2 {8 S! k4. Provide methods to:; Y ?/ X2 Q6 o. e+ ?
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 match1 V Y- q$ L# r
b) return the name of the authorised user
2 J/ e6 `" {' p2 H2 rc) return the name of the department of the authorised user
$ J* X8 e6 P" PIndividual Data (Maximum 20 marks available)6 x5 [1 O& b# }" t: a- u
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.5 H1 R* D: _# y8 U, o+ q! K3 K
Documentation (Maximum 10 marks available)6 \5 P6 a& M& H8 W) 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.$ X \- f% v6 |4 c% C0 Y
BSA104 Business Programming – 2007: Assignment 2 U+ o% O1 b' N, l6 K6 r U/ v
Page 3 of 5 |
|