|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
0 Q$ \0 c3 m$ J; `# EShanghai - 2007" e/ U2 i. m% h$ J4 G/ ?+ b, b
Assignment 20 z1 A' F& U' B$ \2 g9 [4 O0 l
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)
+ z! K3 f3 y( ?6 E1 _" q! L" |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./ `* m* C5 O" u" o# |0 Y" c6 N' S
The staff must be able to:
5 I; V4 ]2 D: q. b0 J: n Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.6 t. {0 T0 C" g5 R3 U9 c7 ~
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.
# P- Y' d$ u0 x8 d" ] The interface should provide a menu so that the staff can:
/ @/ M5 p$ R3 Ba) Enter the names of the two Java program files to be compared
, ]1 H2 y, k3 ]0 f4 w3 Z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
0 a; ~7 J* a" o; o** 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).5 c# e' m) O) a5 q# ` r9 F
BSA104 Business Programming – 2007: Assignment 2; O& C3 y& Y9 y/ H7 m. K! |1 L$ _
Page 2 of 5
7 N: l) l; A5 G Ob) Print out to the screen all the lines of code that are the same8 ]3 m( _; x' a/ I' n" M
 Include the name of the file and the line number of the code being printed for each of the two files" u$ B, e( u0 \2 I, C/ u0 o3 P
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared0 |4 L' R0 @9 ^ s" Q
 the name, username and department of the user
* p# v: e' @3 C- f the statistics of the comparison
4 H: r, A( B f7 l( t- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different8 `" v& E2 x F8 v* f) ]+ I1 o8 A
 the recommendation for further checking. Z9 @' @. w. V' b W! V6 {
- 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
/ Y# U: e* I; p0 Q$ i the names of the two files compared! U# t: F' ^2 I% R0 F" g. z6 R, A
d) Leave the program (exit)
' M+ m0 J4 x1 d- r7 ]" TThe ProgramCompare class: (Total maximum 20 marks available)
* |0 R9 I$ D e# Q2. 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)" Z. d# x- ]* K! p& l5 p
a) provide an error message if the files are not found or there is a problem opening them' ?# _; d3 V" c6 ^; a8 Z# n' q$ s
b) compare each line of code% i$ N! i% K' X& G
c) print out the lines that are the same0 s4 F7 ~1 R8 p+ M, N: ?
d) count the number of lines compared / lines the same
9 D( o% f7 O" F" N! X3 T0 a! j) uThe AuthorisedUsers class: (Total maximum 20 marks available)0 Y& w* E+ y6 K8 j4 v1 T
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)
' L/ ?- x. |8 [/ ~ T4 G$ C1 w4. Provide methods to:
* _/ f8 |! ~ l# H$ La) 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
" |; |+ y( j( L. c! Nb) return the name of the authorised user
. z; j. A- N) b! e6 o% {c) return the name of the department of the authorised user
0 o) B/ ^6 c8 `3 |# y3 h' OIndividual Data (Maximum 20 marks available)
! g1 m4 p! J( @# _" K5. 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.
. O- }8 N! C( G, d9 S6 [* Y5 XDocumentation (Maximum 10 marks available)% R0 D1 a9 Z" ]/ v% }+ {, _
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.) f# s5 A1 [0 T+ E9 K
BSA104 Business Programming – 2007: Assignment 2
% G9 u; l! F8 `* \8 g5 Y+ C' mPage 3 of 5 |
|