|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming7 Q1 p. {" [6 T$ r2 D: a
Shanghai - 2007
7 h% {% W4 S, X0 ~7 y6 M. y0 X$ KAssignment 2% E% V8 N' X4 `0 q$ g; S
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)
2 I0 E# J9 Q% j/ l- p' O1. 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./ u, ?8 l; u9 O& h8 ]4 v
The staff must be able to:5 j b! c( }1 l# I# g2 x) `
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
' K+ {0 J1 Y) F1. 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.
$ b9 w" p' ~* z The interface should provide a menu so that the staff can:; B6 L! U; m, M. g# f0 d
a) Enter the names of the two Java program files to be compared
' y! b& R% L3 x v. }# e For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; r w3 v, ^! C) w- b, }0 i( @** 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).: d4 W1 c' f1 h3 J/ y$ [! @/ b
BSA104 Business Programming – 2007: Assignment 2
4 o z: R i9 ?1 C5 a( DPage 2 of 5
! U. \& o8 D5 P: ^b) Print out to the screen all the lines of code that are the same
i9 o) n' W' l4 o Include the name of the file and the line number of the code being printed for each of the two files$ \# X3 W) ^! f' r: j
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared: _# s$ ~/ z! `" ~' @( \
 the name, username and department of the user- v1 R; G" t. _0 e4 V1 u- r- Y
 the statistics of the comparison
3 c1 z& e# F& T8 J5 f- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different, I# H8 s& Z) X) P' z" e
 the recommendation for further checking8 r) y* q) D/ U; 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& t" m$ ?: d1 \0 i2 s7 a; |$ B
 the names of the two files compared5 H- v# P$ D5 y
d) Leave the program (exit)
9 |+ }/ v+ `7 DThe ProgramCompare class: (Total maximum 20 marks available)2 F% V9 \4 j' J5 l1 C: c4 }/ [3 P
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)8 b, z+ j. a5 B- v2 Y1 r P
a) provide an error message if the files are not found or there is a problem opening them+ i( o. Q& F( Z' w' O4 X0 p/ [3 J
b) compare each line of code
9 _2 s; b/ n' q0 O4 S. xc) print out the lines that are the same
# o* z, ~% B# w, fd) count the number of lines compared / lines the same
5 U- U0 z/ a, O FThe AuthorisedUsers class: (Total maximum 20 marks available); [- C' g+ O1 x0 p+ `4 j
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 c9 [8 n* h: S5 H
4. Provide methods to:
) P$ t0 Y8 W I1 d+ w0 Ca) 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 f, ~. X+ T1 p! }5 e8 I7 r
b) return the name of the authorised user
# Y! w) [& m# w4 u! q, c. |c) return the name of the department of the authorised user
6 ?$ b+ r0 s) e( j' nIndividual Data (Maximum 20 marks available)
. J. q) v# r4 _' E5. 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.
: @# f1 n( d& l# KDocumentation (Maximum 10 marks available)
2 J' y% e3 I% Y' ]" [* _4 i6. 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.
z* F- \3 k0 MBSA104 Business Programming – 2007: Assignment 2
1 A# l0 W; H7 V5 rPage 3 of 5 |
|