|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
( m# h5 i3 S+ V- I) A$ ?. XShanghai - 2007* s% C+ x, V9 \% D! |# D
Assignment 2
. m; `* Z6 x' N1 }) MDeadline 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 Z5 ^$ j/ P3 t3 I 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.$ @4 u9 T8 I1 M+ p+ T
The staff must be able to:
) b2 r) d6 X/ q+ i0 { Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.% C: C# C) ^1 I3 o8 _+ N0 C* P4 n/ T
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.
. O9 y- h4 a8 r) `5 ?/ k# x The interface should provide a menu so that the staff can:" }. T o, j: T8 x3 S
a) Enter the names of the two Java program files to be compared/ Q% }/ |: N3 U1 G: P! P4 l
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; Q" d) a# h8 s4 }** 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).
/ i& w$ t2 |5 m$ `6 |& D8 D3 i9 EBSA104 Business Programming – 2007: Assignment 20 o- o4 q( e; `- A) ~' Y
Page 2 of 5
1 s0 t+ h L- M- T: f% U, zb) Print out to the screen all the lines of code that are the same
0 i# t5 R$ v+ Q- A. { Include the name of the file and the line number of the code being printed for each of the two files
, D) V* a V% u! R4 Ac) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared9 ?7 z! {) A% y; H1 [" U" a6 g# z
 the name, username and department of the user- r5 z! R! t9 n& X# f
 the statistics of the comparison" T/ ?) ?" L: m% ], t# a4 r, q( w
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different1 M5 c( `2 G" |, }( f4 l- v8 j/ }
 the recommendation for further checking
7 A# C% k" ]" R" Z; q, Z* h# \- 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$ ?) f! }; d" Z% r
 the names of the two files compared
# f, @5 _* W4 U) d" H1 n g! od) Leave the program (exit)# ~! G; e4 L: k1 z) \
The ProgramCompare class: (Total maximum 20 marks available)3 }- R) k* i8 Y8 S+ E
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)( A7 o: a' M% k2 y
a) provide an error message if the files are not found or there is a problem opening them
4 I+ g& R0 v- k' {- f. Qb) compare each line of code* r" \9 ? }( m9 t* T' f5 b: m
c) print out the lines that are the same
3 u+ o- R' X1 E" i2 g. m/ Q2 ]d) count the number of lines compared / lines the same) W8 T1 M) r$ r8 R1 a: c. e
The AuthorisedUsers class: (Total maximum 20 marks available)5 t1 }, c _& G! | }5 v
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); v1 w. c. ?$ S- A8 K! {( H/ ?
4. Provide methods to:
/ u, u8 N, c: I+ D7 _% q1 Ja) 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" j3 \, N! v% f/ F$ u; b3 F, r2 D
b) return the name of the authorised user9 _& B& ]: g, i1 w5 G. M4 ^, [
c) return the name of the department of the authorised user
) H" P5 ]6 D. ~4 XIndividual Data (Maximum 20 marks available)! p5 R* o: V: f1 `
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.$ l( C4 u: w3 g' [. g
Documentation (Maximum 10 marks available); S1 {( D: c$ n# z8 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.
* ^& E4 [% I+ [: g0 EBSA104 Business Programming – 2007: Assignment 2
) f6 H9 f9 Z1 A. I0 T3 |, `! tPage 3 of 5 |
|