|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# Z6 M6 z6 i. _" t+ ^Shanghai - 2007
c" Y& f& p; d1 VAssignment 29 t) r: r: T4 O" t
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)7 i; ]& k$ Z6 ^+ b) G0 V
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.
( K: N: ~6 e% F1 \5 u/ |The staff must be able to:: H# v2 n3 |! \5 [
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
$ t7 O4 k7 @3 ^& b7 r! G8 ^$ i$ Z4 C1. 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+ C1 \1 i The interface should provide a menu so that the staff can:2 Q9 }6 K7 v; @0 l! ~4 f
a) Enter the names of the two Java program files to be compared# |7 N) J0 T# Z A# s1 s
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
5 z0 W: W& r2 i2 W$ C3 ?** 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).
) o% d. j. t- U! D4 oBSA104 Business Programming – 2007: Assignment 27 `1 y! T$ k6 |3 F+ Q; X; a, g/ x T
Page 2 of 5( `. L& n; v# v, i+ G/ S
b) Print out to the screen all the lines of code that are the same
% P; a& e. T5 ^ `: I$ \! } Include the name of the file and the line number of the code being printed for each of the two files6 [; A, {' W8 @
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
5 s+ j. v% Z+ h, L9 U the name, username and department of the user
, z; B9 o; X7 b2 T the statistics of the comparison
& o% Z% G! x7 d* ~4 V- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ D* e4 K8 O( ^" i
 the recommendation for further checking
& i/ T4 z- O/ u9 ~- 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
9 b0 u5 y' l) x% Z- R$ n9 Q% e the names of the two files compared
- _* ^/ f8 p% U2 J( J+ \d) Leave the program (exit)
" h' Y! @9 ~( C2 m5 cThe ProgramCompare class: (Total maximum 20 marks available)7 e4 E) z+ }7 [1 d& f2 z
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)& C- x0 _6 Y) H( h, Y; h& h2 l
a) provide an error message if the files are not found or there is a problem opening them
7 \- i% T) w* L' `b) compare each line of code2 `1 t0 c- o! c. W- B" O
c) print out the lines that are the same
& y+ {3 ^) I f! u% T; E- s/ I" ~d) count the number of lines compared / lines the same6 H3 m$ C( j o, K
The AuthorisedUsers class: (Total maximum 20 marks available)
4 A' F1 }6 d' L5 b- j3 h3. 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 M6 x: s, O' \+ G# C& {4. Provide methods to:% q7 O: Z* r, X- j% k
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 match
1 D9 o% `% O/ L" g) x8 x! wb) return the name of the authorised user4 g: \; S7 M. G, g& d& {. c* \, y
c) return the name of the department of the authorised user- j" q5 w% ~0 t9 z
Individual Data (Maximum 20 marks available)2 y9 E& I4 Z, V( j
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.
# w7 M1 g% D9 q# h1 qDocumentation (Maximum 10 marks available)/ q4 f$ L! a' J
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; L$ \) H9 l3 n( T) S; W( A* r
BSA104 Business Programming – 2007: Assignment 2+ q- H+ a' }! @' [: I" s
Page 3 of 5 |
|