|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
$ L1 m- L1 U0 _1 `5 WShanghai - 2007
2 g! s; q$ \ f- ~) O' ZAssignment 23 } D7 b. N; i8 T4 R& W7 D
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)0 b. Q$ D8 K3 [
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.
+ d$ S/ N/ Q5 z9 MThe staff must be able to:/ O( Q6 Y6 `( i2 o8 d' |
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
3 z5 r P+ A0 f9 L( ^; Y3 e1. 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.
, Q) E! G' E: i The interface should provide a menu so that the staff can:& f* i- `- ^$ V( p! k1 S; M
a) Enter the names of the two Java program files to be compared0 d! ~0 c$ A6 I( y
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
' E0 b0 e) ~$ m9 J+ ^& I! E 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).+ x: y: S1 a* j2 g
BSA104 Business Programming – 2007: Assignment 2
/ ]5 n3 f# F3 o3 x) k; PPage 2 of 5* @' Q' P' q+ m& i4 Q
b) Print out to the screen all the lines of code that are the same
1 H- g9 r g& e Include the name of the file and the line number of the code being printed for each of the two files% U& f0 o4 K0 e# _" [
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& U7 s+ A( x" q2 L4 _5 |/ [ f* e the name, username and department of the user* D' x9 h B2 m( Q) \
 the statistics of the comparison
0 }) h) v/ `+ g- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
& f6 D2 i& x# _, `5 Q( @5 Q% I' | the recommendation for further checking
* c. o4 N8 u1 j! {7 L7 }) 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
3 r9 \5 c5 k u' A6 ?0 m9 J the names of the two files compared4 x$ f9 u7 c8 a! O6 r
d) Leave the program (exit)
$ n8 G$ D9 A. j0 h9 Q# X% ^The ProgramCompare class: (Total maximum 20 marks available)
( ]. W9 b0 {( D2 P2. 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)
6 Q( g) c, K3 [+ M! _$ Ea) provide an error message if the files are not found or there is a problem opening them
) a% o, l2 H6 ?6 h; c) B& M- K" i, p7 Yb) compare each line of code
8 @" S& C( X% p* J1 D1 Kc) print out the lines that are the same
" s0 S' ?( Y+ td) count the number of lines compared / lines the same/ e; T6 f7 M' j" p; a3 o
The AuthorisedUsers class: (Total maximum 20 marks available)
d2 ?2 @# c! L5 F4 r) u4 C. ^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)
" q4 l8 v( J* V; ?. D4. Provide methods to:( g G& g, ], E7 Q0 H; Z& V
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
( Y+ h1 ~3 ^, [ M( D9 ab) return the name of the authorised user
/ P5 ~* i& R3 O9 ]0 fc) return the name of the department of the authorised user
$ ^; y O1 g# eIndividual Data (Maximum 20 marks available)
% q j. d$ _' k; L5 ^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.
. B0 _- \( f$ Y+ e9 eDocumentation (Maximum 10 marks available)
% _) m3 w! E6 }6 _/ _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.: V" |7 T) w- N3 c
BSA104 Business Programming – 2007: Assignment 2
0 \" l# t) g* O$ |Page 3 of 5 |
|