|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming% g2 V" g9 Y& d B9 n D
Shanghai - 2007
8 v# z7 J/ w- g2 ?% e* l- tAssignment 2
# |' K6 ~- l" g Q; g: B' ]6 E. R fDeadline 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 K/ I8 F( a& \ [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.$ {( i# ~0 u, [* G, G- u6 M( B
The staff must be able to:1 R5 W c5 J; s- @# @: F3 D9 l
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
' f8 t( ^3 k0 h1 V1. 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.
: K3 T* ^5 j/ O' L The interface should provide a menu so that the staff can:
3 d( {* O! M0 ]: K t4 ha) Enter the names of the two Java program files to be compared
e) p, q8 \: \; }6 X; T2 ` R For this assignment, it will be assumed that the two Java program files are in the same folder as your program., f* b+ d: V- D( K" v U
** 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).
" v0 K; _. z. ]1 \* R1 IBSA104 Business Programming – 2007: Assignment 2
Q% l, S$ d, \* [9 aPage 2 of 5. U; ?# x8 y& t5 L s& B
b) Print out to the screen all the lines of code that are the same
/ a9 m0 V5 E3 O% @: ^ \9 ] Include the name of the file and the line number of the code being printed for each of the two files
, X! [8 C7 w7 n9 r: q1 V4 hc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared! `+ b' f0 L. p2 P# o
 the name, username and department of the user: c2 ~- T7 k5 U1 A/ ?
 the statistics of the comparison# @9 G7 Y+ Q" S- h# g8 b
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
4 \' H7 E# j( l! l the recommendation for further checking
$ }. L( d& M" E2 R8 i2 t9 _- 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
- y6 m, R( g. m the names of the two files compared
$ [. h0 l W6 [+ |, nd) Leave the program (exit)
* |" ]8 ]/ r( j B9 Q& zThe ProgramCompare class: (Total maximum 20 marks available)% D) h& y6 \4 u! v3 Z
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)
' `5 Q( Q- m7 [% L+ J N; Ua) provide an error message if the files are not found or there is a problem opening them- z3 d( Y5 k8 X) S
b) compare each line of code( J1 g" Z$ a2 I+ v, |5 }
c) print out the lines that are the same, C+ T/ e$ ]3 N/ `; A
d) count the number of lines compared / lines the same1 w6 r1 f3 A" t# x {
The AuthorisedUsers class: (Total maximum 20 marks available)6 S7 D0 y9 I' M6 n; k+ h% [. l$ f
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)
8 e7 n$ V) @' A [. Z: X: O1 x4. Provide methods to:
$ J+ {6 r* [8 [' H# I$ m, l. ?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
* S& W. R! }) X4 E0 f8 pb) return the name of the authorised user# O3 a0 Y. t' ?& i4 o
c) return the name of the department of the authorised user
8 Z, ~3 |' N: |. o- c7 uIndividual Data (Maximum 20 marks available)) ]4 ?3 C3 S0 ?2 o0 [1 J0 e# f9 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.4 l3 a, w0 t5 E% ~$ D4 p* x* t% n
Documentation (Maximum 10 marks available)9 @' |9 S/ H2 E% 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.
/ V6 M, H8 I7 mBSA104 Business Programming – 2007: Assignment 2' O* @9 H/ I: P
Page 3 of 5 |
|