|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 `0 D6 v7 I1 v( F0 d+ ~Shanghai - 2007/ a/ S& \6 J6 `3 l. X7 \' {# {* D
Assignment 2
4 q- Y5 q# x. j6 P& XDeadline 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)
, c; g! z) z; ?6 T8 b/ t4 p, R; x D1. 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 E$ _+ \' ^( i5 DThe staff must be able to:
: d% @( W/ T! N6 V/ }* M& i Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.; ?( }+ E! n# b3 o* g. K* ?
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.
; } ~/ L$ R( \ The interface should provide a menu so that the staff can:; c! b) w2 ~% P/ s, Q. S* U
a) Enter the names of the two Java program files to be compared' d( x! f! R" V% \7 N3 P0 U
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
( |1 s% N+ T% N$ [7 X2 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).
+ z5 o ]! l; m: X1 WBSA104 Business Programming – 2007: Assignment 2$ l% L, {1 K" C) {
Page 2 of 5+ V @2 r8 p' X
b) Print out to the screen all the lines of code that are the same& m9 J# `: ]+ V+ A# j
 Include the name of the file and the line number of the code being printed for each of the two files# ]' Y* b" R3 V, W3 a; b9 e, L
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
3 _$ `/ ?1 I! v8 k0 ?# [, e9 | the name, username and department of the user' n6 I. q& v9 Q1 ?# q8 y
 the statistics of the comparison8 w; v( l" H5 h! ^9 A1 b
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different6 c+ f1 |7 ?$ w3 U3 x; ?( a7 K
 the recommendation for further checking3 O Y% B ^( z; |. @2 g0 K* m- S
- 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
. E2 d' h N! q* `* ]$ g5 y1 Q the names of the two files compared: g6 ~0 N9 e3 E3 N! b, y
d) Leave the program (exit): `5 T- c& J1 Y
The ProgramCompare class: (Total maximum 20 marks available)
. M m3 o, e& O2 Z3 r; E2. 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, ^0 M, n1 @6 T! }a) provide an error message if the files are not found or there is a problem opening them4 ?8 L: u n* ?3 }' j: Y0 f6 y
b) compare each line of code
- k* \/ w& N/ B3 Q" v2 h$ z! Hc) print out the lines that are the same
/ v* i! Q/ s0 ` M" zd) count the number of lines compared / lines the same3 x6 I5 ~. V# o- E1 x/ \
The AuthorisedUsers class: (Total maximum 20 marks available)
7 v2 I7 R7 f, d% f/ C3. 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)
9 O2 Q" u1 a2 e2 k, e7 P# _8 N4. Provide methods to:+ {, v( k) | z# b$ i
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
+ K5 I# W; o1 D( Ab) return the name of the authorised user8 l$ X* e: M# v$ U' Y. o0 K
c) return the name of the department of the authorised user( W% ?2 X: G g. P, N6 g# A6 d1 A0 q
Individual Data (Maximum 20 marks available)
, W7 L, h( c( D8 A: T, L5. 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.
- r. a0 w. ~& FDocumentation (Maximum 10 marks available)
/ l6 E/ b9 X7 e2 q! T* n6. 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.
0 c8 k6 p5 n# ^2 G1 K# v' VBSA104 Business Programming – 2007: Assignment 22 `0 w; b1 G ^8 A1 ^2 P. V' A9 U
Page 3 of 5 |
|