|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
( {6 H% ^8 A% T8 O1 wShanghai - 2007
/ O2 f$ a: V* z8 W$ L% NAssignment 29 e& J! L1 b2 K& D# l6 t$ N+ B3 O
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)9 W+ j5 c6 m8 a+ Z
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.
' ~8 \& Y" Q* [: K ?1 _0 cThe staff must be able to:. w" E4 z6 g% @' a( o- u
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
+ e# I/ d- q2 s3 m; C1. 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.$ L1 j, }' x) z: J, b( h0 k5 V
 The interface should provide a menu so that the staff can:
6 H+ ~: s9 d5 Ua) Enter the names of the two Java program files to be compared
; Y: |- B& p! w For this assignment, it will be assumed that the two Java program files are in the same folder as your program.0 [8 T- t: J( V/ j
** 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).
# K/ S1 C4 i+ RBSA104 Business Programming – 2007: Assignment 2
+ j. @9 N6 H3 a, F, bPage 2 of 5# I' d) V7 u7 {+ r6 l
b) Print out to the screen all the lines of code that are the same
5 H, d$ S- ~# A/ a9 x! {5 Q% m Include the name of the file and the line number of the code being printed for each of the two files9 v' g; `4 S! U. G1 S+ X
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
2 X) ?2 G! {" ^5 G: c" r/ M the name, username and department of the user
9 b, M- q: K. X ?% u the statistics of the comparison
8 d1 Q6 B, r) R) v- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different( O3 _3 l$ Y# a, t% y3 n
 the recommendation for further checking }8 J6 e5 g3 w9 t
- 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
/ d$ y: s! c, x) n# g6 O& k# t the names of the two files compared
2 p% `: }& Q" N' U. O3 H; q. id) Leave the program (exit)
$ R: }$ V8 W2 A! C( WThe ProgramCompare class: (Total maximum 20 marks available)
6 l' ]2 d# j8 n* w1 Q3 e, _, _0 y2. 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)
& f$ X0 |7 D- m9 ]( v; Da) provide an error message if the files are not found or there is a problem opening them
% M* {9 e3 V6 O, v: Y% \" rb) compare each line of code
3 e! m( p, f" h5 n5 Dc) print out the lines that are the same# @8 q- d' ^7 m
d) count the number of lines compared / lines the same
- ?( [& c2 j% U/ K( u' O/ nThe AuthorisedUsers class: (Total maximum 20 marks available)
* a1 @1 q) a6 ?" v3. 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)
@1 f* B% T5 G5 X& w: w& X$ P3 A4. Provide methods to:/ i, l' H3 I, H0 e7 J( P1 T
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
9 i3 w: `, x, g4 u7 y; Gb) return the name of the authorised user
" j9 g" |2 s9 M" I5 Z; a$ S9 qc) return the name of the department of the authorised user3 i0 l \/ j) r) S( p
Individual Data (Maximum 20 marks available)
h% |$ y7 \* V( y) o4 N5. 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.
# ^) u% R! ]# \. t6 y& ?6 QDocumentation (Maximum 10 marks available)
* R( q: x2 D' N- q$ A: f6. 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 {& U( C0 G; x& C. j
BSA104 Business Programming – 2007: Assignment 2; A$ p; v+ a; ]7 y
Page 3 of 5 |
|