|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming& F- a* [ [6 f8 {' @+ G' z' V
Shanghai - 20075 r" S8 ~& A( u& n! c9 W/ m
Assignment 2
1 Y. p( d1 b, ?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)6 V) A8 W6 [4 a# I( j
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.
. d# ~1 N* V1 v) d' V6 Y6 X Z+ cThe staff must be able to:5 x$ l; `) h; v$ v- h" s
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
" @; B' L& B3 |* t1. 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.
5 k/ `& p, \! n/ h" b The interface should provide a menu so that the staff can:
6 \+ U9 C8 C* \$ m$ @' Xa) Enter the names of the two Java program files to be compared
0 P. ?* K1 f+ {/ y- ?2 j: @$ O For this assignment, it will be assumed that the two Java program files are in the same folder as your program.- r, O8 W1 ^; h; u
** 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).
! H; K- @1 \4 T: k4 RBSA104 Business Programming – 2007: Assignment 2
# ^0 r4 I) ^2 \2 Z+ m+ {. PPage 2 of 5! d6 y$ m! F9 T( b; {/ ^* L
b) Print out to the screen all the lines of code that are the same
" y t9 J. u R# g) p2 k4 q, n Include the name of the file and the line number of the code being printed for each of the two files9 B: Z4 m* I9 x# o: M4 f
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared% K+ i1 H& x- {6 t
 the name, username and department of the user
( m; q. U5 U( X* I+ A: D the statistics of the comparison
4 g6 W- P- T6 n3 J2 g! H K- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ K( m: V% {2 ]( N8 V# U# t the recommendation for further checking
4 u8 x: `) _' ?5 Q: N3 K- 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
% a0 R& I- k4 n$ L1 t* t the names of the two files compared" ?9 r& L5 }% ^, t5 X( k8 q
d) Leave the program (exit)( s- L- m9 E; R
The ProgramCompare class: (Total maximum 20 marks available)' V% N2 |9 D: a" ^
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)
3 j Y. y' \$ ~# I& E$ N/ Va) provide an error message if the files are not found or there is a problem opening them
4 ]. T3 H A! X+ S' ]* Ib) compare each line of code
) @ f6 g$ q. f0 @6 `2 G+ \1 }c) print out the lines that are the same: ?9 t4 G L+ t6 d0 j2 y" k
d) count the number of lines compared / lines the same
- r J* K$ E: Q. tThe AuthorisedUsers class: (Total maximum 20 marks available)/ k6 T# I x! D' h' S2 D+ } U
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)! h. V0 H7 }8 Z& e5 c6 \/ ~- Y
4. Provide methods to:5 D f' F5 h+ ?1 g" O
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 match4 o, u: Q5 r' J: b
b) return the name of the authorised user
( I7 u- m" g8 q1 L7 i3 c- \c) return the name of the department of the authorised user/ p8 n% z! i' h" X3 S* Z
Individual Data (Maximum 20 marks available)
" R7 p% ]$ q* z9 l0 X' i& g5. 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.
6 | e+ H! }5 B2 b! h6 T2 B/ ZDocumentation (Maximum 10 marks available)
2 ?8 B. @6 u4 n" Q: z6. 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.3 x- z, K0 `3 q1 U7 u% }
BSA104 Business Programming – 2007: Assignment 2
8 {5 \* R3 d* mPage 3 of 5 |
|