|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming1 X+ x4 i0 u: Y) Z7 I9 j
Shanghai - 2007
2 D8 B9 y7 p9 c, N9 oAssignment 25 X8 H( f- Z, p5 A' N
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)
3 D/ @# n5 f% g1. 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.6 Q& |) [1 e$ |$ G4 X
The staff must be able to:
1 O- F: {3 L6 J; D T% z' q: T Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! |5 T$ s/ {& d
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.7 e2 B& c' O$ R, c w
 The interface should provide a menu so that the staff can:
- W* l: k" w8 j) Za) Enter the names of the two Java program files to be compared
& f7 a, ^9 e) y4 T* {( r For this assignment, it will be assumed that the two Java program files are in the same folder as your program.3 @( X5 K S8 B ]9 {. G$ B0 T
** 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).- @+ Y* d# u2 q6 f" a% Y2 S8 l
BSA104 Business Programming – 2007: Assignment 2
5 a. H* w) Q, [$ M& N* gPage 2 of 50 D! V# t$ ~# e
b) Print out to the screen all the lines of code that are the same T' ?$ t+ ]1 M) j4 c1 G
 Include the name of the file and the line number of the code being printed for each of the two files
4 ^) t E8 h, n& Ic) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) C( ] Y B% X! H
 the name, username and department of the user4 i |' X, W, a" o' w# u0 t
 the statistics of the comparison; W' D+ V; X: K5 l# f7 F, h6 K* F* I
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different8 y9 G( E, ?, L+ g4 l
 the recommendation for further checking
* p5 G3 k: z! N8 O- 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
; ?: b# N/ U3 v' r% s/ [ the names of the two files compared. b0 k \( I' U7 w9 R- S
d) Leave the program (exit); Q! i: l* z! R7 I9 u* K9 @
The ProgramCompare class: (Total maximum 20 marks available)
0 k K5 V2 x3 M' q! G5 Y2 \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)9 n2 k7 ^# |4 f# p7 B" S$ n
a) provide an error message if the files are not found or there is a problem opening them
# e: L7 ~* L1 n5 bb) compare each line of code+ l& w0 m6 W( n# y- k8 O% X8 J
c) print out the lines that are the same2 _$ e* }7 s' P
d) count the number of lines compared / lines the same
: E$ W2 v3 `9 D6 `# }The AuthorisedUsers class: (Total maximum 20 marks available)
. U M- \. U9 e3. 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)) h" N7 T$ P! \9 R( i( J
4. Provide methods to:
6 ]+ V- R( H! _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 match0 y. q/ B4 ]* j9 v0 r9 k0 d
b) return the name of the authorised user0 t( ~6 c! a2 _$ w( c7 x
c) return the name of the department of the authorised user) {7 J3 T y M8 c9 K
Individual Data (Maximum 20 marks available)5 J6 T; r9 n& g/ a, }/ Z% y9 {8 C
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.. i% o, j: U- G
Documentation (Maximum 10 marks available)
' ?6 s5 j. D7 @8 \+ }/ _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.8 x$ d( T# Y/ j
BSA104 Business Programming – 2007: Assignment 22 c' i( A. F+ v% a# {- e
Page 3 of 5 |
|