|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming& i9 w2 ]) q+ R" |& K7 |" M c
Shanghai - 20072 S- T# i' r/ @# h
Assignment 2( u: ~5 r# m( i+ n- Z, h2 W U
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)9 |) A6 w, ~9 n, P" f
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.& A; W7 y% g# p' \
The staff must be able to:+ u: h6 n, G# u
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
/ A) W9 e- S6 \4 S% G1. 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. M/ k& S, R& _- f4 R) p, p K
 The interface should provide a menu so that the staff can:* K+ m9 D1 {9 |# q5 Z8 M
a) Enter the names of the two Java program files to be compared. A3 c8 ^1 H9 i( a; S( ^& y j
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.$ i+ {" }) X7 k! l4 ~5 x0 _2 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).) G+ |/ s+ O! h; {9 o; x
BSA104 Business Programming – 2007: Assignment 2
6 y4 L" V2 m9 _. J+ w& [Page 2 of 5$ {6 l0 ?, x* O' H6 H6 j. N6 D3 ?/ c6 H# x
b) Print out to the screen all the lines of code that are the same5 d$ e8 j4 m8 U/ s% C/ A5 [6 }2 N
 Include the name of the file and the line number of the code being printed for each of the two files3 ?0 w s; M" \- d. z+ e/ d
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 O0 ]6 x6 I! `3 e0 D3 B$ U
 the name, username and department of the user. J' v9 a6 N9 g9 ^
 the statistics of the comparison" `4 q- f$ H. a J
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different! U) E1 H% K! H/ ~- e, N0 s: K% B
 the recommendation for further checking& g( ^1 Z- X" ^8 a& q
- 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
. S5 @! t. Z1 b the names of the two files compared
. }6 |) E+ D$ b9 O K+ Cd) Leave the program (exit)
. {4 S) y/ t7 V" |# TThe ProgramCompare class: (Total maximum 20 marks available)' t: p# m7 j$ w- i Y9 m1 D
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 P4 I! l7 C3 j) j" A' ma) provide an error message if the files are not found or there is a problem opening them# W; g8 @$ J9 }0 U9 C) w+ |, o
b) compare each line of code
5 R( `* B; J. M! A7 i* Xc) print out the lines that are the same" Q/ E% T: {7 {: f
d) count the number of lines compared / lines the same) C# S9 U- Y) z
The AuthorisedUsers class: (Total maximum 20 marks available)+ `: l# W, p* a2 F" I$ c* b
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 p+ [, O9 m9 g- j4. Provide methods to:
. A+ r3 z0 g0 \: V4 }, ?+ @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 match9 C: O8 B/ U: q
b) return the name of the authorised user
, C' g( h+ `5 j' ~c) return the name of the department of the authorised user4 T! t) k6 A. H* g4 f( T
Individual Data (Maximum 20 marks available)
* ^- Y) |8 A2 l; U- r( Y7 C5. 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.
+ i* S1 Z& ~/ Q7 x NDocumentation (Maximum 10 marks available)
6 G7 {8 m) |! [6 J6. 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.
0 j0 ~+ f0 f3 D4 C7 ABSA104 Business Programming – 2007: Assignment 2" \* a Y; U" U' L6 K; B
Page 3 of 5 |
|