|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 x0 |1 \) {2 k' N2 ]- Y2 P( s: L& D
Shanghai - 2007# H5 `$ I7 ~7 H: \& f, `: V
Assignment 2; F3 ]( R$ ?5 o- k# \
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)
/ J, V6 m! M8 @( a5 ~5 }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.$ p$ L: L3 F* {* U3 O* i: V
The staff must be able to:: o. ]: J6 l3 `# _9 o4 `9 [5 m
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
3 v) ^: `7 x, ~+ x% S2 F1. 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.4 m6 `, C- @! P4 O* X
 The interface should provide a menu so that the staff can:2 U! u1 @5 x9 e1 G N! o/ o
a) Enter the names of the two Java program files to be compared( _& U/ g0 p% W) K3 n2 V; l' O" Q
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
: q2 V" U4 j# Y' L8 |** 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).
( A: X/ Q) J0 |* T! kBSA104 Business Programming – 2007: Assignment 2
3 U! z9 @% W( pPage 2 of 5$ I$ g+ ?3 z2 m+ S$ S& f
b) Print out to the screen all the lines of code that are the same8 R+ j: v2 V' U4 a' t# I3 R/ v
 Include the name of the file and the line number of the code being printed for each of the two files
6 k" E, u/ S ac) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
* ]) }/ F" Q9 c the name, username and department of the user; b d1 X& S5 O; r9 }
 the statistics of the comparison* A' T; X& H8 W, [
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
8 ]& c: z1 x; C6 ~, V. u% V the recommendation for further checking
' n% ^' `: g. c" b, O' [, F* t! u) o- 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
: ] M5 _ g1 Q) q" T the names of the two files compared
3 H4 \. l& U- Sd) Leave the program (exit)
! U5 [6 D) i6 CThe ProgramCompare class: (Total maximum 20 marks available): b4 N x9 q7 ?, D* Y7 P: Y
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)
0 }; c5 Z1 @3 Wa) provide an error message if the files are not found or there is a problem opening them" U5 [" ?7 G3 X; H X* K
b) compare each line of code' a, _; b( |0 a- D
c) print out the lines that are the same F2 ?7 o( R3 \; ~. R+ O& t
d) count the number of lines compared / lines the same3 Y3 N. p, W# a# U
The AuthorisedUsers class: (Total maximum 20 marks available)% ?4 k( I- f4 q4 o
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)+ ?7 ~+ Z! L$ E
4. Provide methods to:5 C6 y, N. J9 d( K9 H. T% n
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* v, M2 ], y5 l, n+ i& P( y2 k
b) return the name of the authorised user
5 R h' ?0 ] Oc) return the name of the department of the authorised user3 X k" w2 J! u5 c: ?* c7 k
Individual Data (Maximum 20 marks available)
; R6 A! i u1 V9 ~" W5 l) c0 s5. 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.
5 t5 W# E) T9 ?Documentation (Maximum 10 marks available)
" c$ Z: V2 C- O4 U. ]2 y% A6. 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.
! s, O% N( C% ?& ~0 O! YBSA104 Business Programming – 2007: Assignment 2/ S+ w4 c# `" p3 Y! F, d
Page 3 of 5 |
|