|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
: t9 C: {) C7 S% r( {Shanghai - 2007
7 \& @/ i0 U" M8 O% x i6 _Assignment 2
- t3 `" }# w2 K) hDeadline 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)5 j( M7 _1 b! U. Q
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.; [6 W& i7 G4 L! E4 |: U9 K
The staff must be able to:3 s j/ X/ ]/ ~5 I
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
l+ u' s7 e8 M+ S. S' o- s( ?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.
/ ]( }: u8 O" f: m# H* E) R2 \; x The interface should provide a menu so that the staff can:
1 M0 Y3 ` J% x- B" ta) Enter the names of the two Java program files to be compared+ L# I. R9 P) r) \1 o& i
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 P3 h# J$ {3 ?
** 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).$ f; {, D7 H- P0 Y
BSA104 Business Programming – 2007: Assignment 2
2 t2 z5 e9 ^4 U& Y0 U3 N9 v6 tPage 2 of 53 \& x& d7 ]/ ^2 D
b) Print out to the screen all the lines of code that are the same: Q/ A% A5 b u) V
 Include the name of the file and the line number of the code being printed for each of the two files
* [: F0 C; h+ V( x4 Fc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 I3 k4 m2 X, G. X" }; o7 A- L& b
 the name, username and department of the user" T/ \! \4 p$ W, q0 q/ M
 the statistics of the comparison! l9 x d$ `5 L3 M0 O, y$ |
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 d' o! c0 E) a( R; b; R the recommendation for further checking
E e# {& ], F) d( e- 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
5 M- j3 H0 o* r- I# V, W8 A/ H the names of the two files compared
/ C% x$ X7 [7 }6 N* Sd) Leave the program (exit)2 u2 g5 B) l y+ Q) |4 Y
The ProgramCompare class: (Total maximum 20 marks available)
$ T" I0 ^2 W) x' B6 ^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)+ E j8 L: b5 v& u/ ^0 i
a) provide an error message if the files are not found or there is a problem opening them
7 F- a* I, f+ @$ ?8 A Q! d7 gb) compare each line of code4 G5 o/ k' N- d' M6 ]
c) print out the lines that are the same
5 z/ w {5 g: V0 U" G) G+ Gd) count the number of lines compared / lines the same" D, z0 }2 X7 i" R
The AuthorisedUsers class: (Total maximum 20 marks available)
( `- C+ a. r, _. L) \; q3. 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)) v$ w2 }- \# `5 N( n- w8 \; A/ _7 N
4. Provide methods to:
7 U2 s$ ^% \1 | i$ u1 }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, |2 g3 X- R O* m2 E* _' `2 D9 E
b) return the name of the authorised user7 X9 Z* K! D1 B; T; i, x# m
c) return the name of the department of the authorised user q. }5 ]( W/ l: _4 y
Individual Data (Maximum 20 marks available)( w8 B2 g+ I6 @$ k* B+ U
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." }8 @- K: M7 Z. }6 X& L$ s& [ i
Documentation (Maximum 10 marks available)
: t8 }4 r2 ~: I6. 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 g8 i4 h, n$ r) S+ ^0 _% g& F4 _
BSA104 Business Programming – 2007: Assignment 2' }: C* }' l6 p
Page 3 of 5 |
|