|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming; L' p- y9 T# m3 h0 o- m" g, c% ~& @
Shanghai - 2007 u4 r9 G8 v+ L5 [
Assignment 2* U) Y& i3 ?( g& H* L0 [
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 Q! b' G' { u+ x _ C, s2 E
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.1 f+ |. K' k) e( x3 B; P. `; T
The staff must be able to:- {" N: Z8 b4 ?" a- K4 J
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! b6 X" q1 `$ @8 K6 ^+ ] I5 b3 A# B
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.$ B5 W3 _' b% G( V$ o
 The interface should provide a menu so that the staff can:
% g, v1 X5 G9 G( \& g; va) Enter the names of the two Java program files to be compared
# l3 K% O' l5 p. @ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.8 y! }' y) f4 T0 q4 H
** 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).
( j8 y5 B; {; i4 ^' b. DBSA104 Business Programming – 2007: Assignment 2
2 E- B5 I8 e" @) dPage 2 of 5% s1 e- B4 a+ t9 T% @7 e X" C9 K% h
b) Print out to the screen all the lines of code that are the same6 Z1 I- o! b8 n! q9 X8 E6 g1 a7 }
 Include the name of the file and the line number of the code being printed for each of the two files
- j6 c! y- S) c. _+ J6 x( h K) Fc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 |% ^" r$ ^% x1 c8 | the name, username and department of the user
( \. w' n* F) w/ j! Y2 h% j; s the statistics of the comparison+ R; W' t) }/ A8 e9 F- v, `
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ G c0 A. S* Y! ?4 G
 the recommendation for further checking
; S% b; z/ P" I* z( I: S3 A- 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
; J. B3 \3 O) G& }6 t. H( u8 g the names of the two files compared
7 w9 f8 O% b u* jd) Leave the program (exit)+ A9 f6 T4 ]. b1 f$ U
The ProgramCompare class: (Total maximum 20 marks available)
, k! e- z `2 B2 v& v% M$ n0 ]) a2. 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)( s1 B3 [2 X. E5 n. u9 k
a) provide an error message if the files are not found or there is a problem opening them% T) Q L, P- V* Y- c7 w
b) compare each line of code7 f. e+ V& M7 }; }$ V! k& y* B& r
c) print out the lines that are the same
. _5 o. U3 z3 v) Xd) count the number of lines compared / lines the same2 M% J% b" k+ f$ f$ x/ g
The AuthorisedUsers class: (Total maximum 20 marks available)$ `% X4 Q( U$ T" g# 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)
$ U: w) \$ f; @$ ?6 f3 ]4 V/ z4. Provide methods to:: K2 Z9 h" b+ p v$ @# 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 match9 x& X" \1 r& y6 y% ?. k# r& V
b) return the name of the authorised user
/ o; U: X% D; m1 F9 r2 O& e7 |c) return the name of the department of the authorised user" p0 R9 n* r, F" `
Individual Data (Maximum 20 marks available)
+ v8 n5 i7 G' k5. 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.
% s4 J% ^" k7 x, GDocumentation (Maximum 10 marks available)! \# i* S" g2 V2 M6 X/ d: n6 J. b
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.
! \. J6 s% _, L2 u9 RBSA104 Business Programming – 2007: Assignment 2
+ G$ E2 U1 U. h: LPage 3 of 5 |
|