|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. ~0 ^5 O) D% h) t+ ?+ u
Shanghai - 2007
, P! U& [5 t% X- X) Y# OAssignment 2% K0 ` Q) B0 w& @5 D( Y2 ^7 {6 x
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)4 P! q; w1 t* S% m* S
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.5 C; D/ D# j2 O: n7 U. `: }
The staff must be able to:5 N7 y r3 w3 G: d
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., H7 A* ~4 `8 R+ K* B# x2 }
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.8 c+ P$ K5 ?# J6 b5 O
 The interface should provide a menu so that the staff can:1 E$ W% H4 j5 q9 b: w3 w6 X2 _" t
a) Enter the names of the two Java program files to be compared
- {7 N% j! p: H8 _. U" k For this assignment, it will be assumed that the two Java program files are in the same folder as your program.1 k" m' ]8 `4 M. D
** 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).5 `8 J3 K" t. ^4 [
BSA104 Business Programming – 2007: Assignment 23 B, z7 q9 K0 G
Page 2 of 5
1 E# V+ q- e$ {- u. A1 pb) Print out to the screen all the lines of code that are the same
8 h0 C7 c9 o' W; [: [ Include the name of the file and the line number of the code being printed for each of the two files& i& d$ K: ~- V+ C' I
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared& A- |( c* X$ g- I( b2 o
 the name, username and department of the user; @, M6 ?* H/ P
 the statistics of the comparison+ h/ {1 @ @* }) _1 M( H. |1 S
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
: I. S( P+ B1 X0 Q the recommendation for further checking
# I& \8 F" Y' G1 Y/ B/ [4 Y& \% h4 q9 D- 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: J7 ~( D' {3 a- Y6 x
 the names of the two files compared5 Q$ j& z8 R$ d5 n7 W) c
d) Leave the program (exit)
- ]6 b& H3 O8 t+ g( LThe ProgramCompare class: (Total maximum 20 marks available). J' D; T1 _7 O# b
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 F; _& Z' Q' r9 I4 E ba) provide an error message if the files are not found or there is a problem opening them$ P$ F( F& [6 n5 d9 l7 s4 F
b) compare each line of code
1 P& @$ T4 A2 l+ d; n+ Nc) print out the lines that are the same
$ x# I- ^7 o* F kd) count the number of lines compared / lines the same9 @0 `8 b) }- ]
The AuthorisedUsers class: (Total maximum 20 marks available)
9 p) i: B- v& N" M9 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) o% ^1 v$ v/ j) X5 ^
4. Provide methods to:
4 ^( ~9 Z9 A) t. P! ya) 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+ z$ d5 R8 m, M/ v2 t& b
b) return the name of the authorised user3 k. l2 X6 e; {# O5 P
c) return the name of the department of the authorised user
# X( V. q* ]+ n# c' y- VIndividual Data (Maximum 20 marks available). x! V% y/ o, C% N X, p 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.0 o+ E7 H, U5 q, u5 e5 x1 a
Documentation (Maximum 10 marks available)/ Y7 I' H) ^, O4 a" e) K
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.' N9 g) T3 U' E* b" Q: ]
BSA104 Business Programming – 2007: Assignment 2
" [& }( b* Y. v- }Page 3 of 5 |
|