|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# j; @3 |8 Z8 S5 k- |Shanghai - 2007
4 o/ _+ C1 d" e: U/ qAssignment 2, D$ X3 a, {4 f# Z* q1 \
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)- L! `! [' R/ u3 b3 r' s* G* }; ?
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 X/ A. t( Z( F1 [& b' PThe staff must be able to:
1 m& n; [2 K5 P; |+ W7 b Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 K7 i9 _1 ~6 c% M) ^# h$ q3 a
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.
3 m/ ]& [9 k0 j2 @4 Y8 V7 Y# H3 m The interface should provide a menu so that the staff can:( C- I3 H( L% J* J
a) Enter the names of the two Java program files to be compared' ?" t' X/ L4 h" y: @: o e* s9 N, }0 ~$ ~
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.3 a3 K3 A- S8 F) i6 m
** 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).
! z3 W8 i7 I9 H' f8 S( p7 tBSA104 Business Programming – 2007: Assignment 2
1 z( i: F& _# p" n9 [; Z$ ]Page 2 of 5
% @) M2 x$ ~; R, g# gb) Print out to the screen all the lines of code that are the same: O. e: I& h5 \2 r2 X' A6 Z! |, X
 Include the name of the file and the line number of the code being printed for each of the two files* _. I* r( ]7 D T) j: l( h
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
: w1 W$ N1 D% O* _0 k the name, username and department of the user
- S, J% C$ b% [3 j; S the statistics of the comparison+ |+ ^& H# x6 b* H
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
+ X5 V7 Z- ~1 D the recommendation for further checking% J F: A. v+ _2 s3 ]
- 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
* {0 Q/ g' s& y4 Q- p& l8 Z the names of the two files compared
. k! y9 i, Z1 L' O/ _( Ld) Leave the program (exit), O7 A( F( J7 G% m% _4 x2 I
The ProgramCompare class: (Total maximum 20 marks available)
. R- ^7 H! S0 h d, T" Y% R2. 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)
, b! Q% V; d, `' W' R {9 t# T! }a) provide an error message if the files are not found or there is a problem opening them( O: w1 F( l, l# p% E; X
b) compare each line of code" U& c8 E# e/ x2 J1 a `
c) print out the lines that are the same! x; i6 T; B. O
d) count the number of lines compared / lines the same
! N& j% d# i3 i6 ]) H' bThe AuthorisedUsers class: (Total maximum 20 marks available)
`1 Z8 U! V) K. W3 b) l3. 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)
8 Y' u' I# w' \9 ^4. Provide methods to:7 X; X& d! }4 _
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
/ N4 N. h8 L" @) g' L0 zb) return the name of the authorised user! X' x5 R; C9 M8 R
c) return the name of the department of the authorised user( K8 N0 u8 R$ y( |$ \6 i2 \
Individual Data (Maximum 20 marks available)
& r5 B- u+ s/ _3 j$ N3 o; p5. 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.
. x1 E- p( E% g3 a( Y( pDocumentation (Maximum 10 marks available)5 s9 `0 N3 a6 c0 A% T
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.) [# G" [2 m/ a" z( i; F* p1 ]! C
BSA104 Business Programming – 2007: Assignment 25 A# t( r p' o( Z
Page 3 of 5 |
|