|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
' H7 v2 Q1 N% M: f. V0 N; m9 D# o0 [Shanghai - 2007
! C8 ]& ]9 ~/ DAssignment 2
/ u* J) ]: N5 y/ B4 @: ]* y" rDeadline 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)) ~1 p: a* l% s) w
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.
! b; c) D! P, T3 t. l6 E% LThe staff must be able to:6 F6 k G9 x: D8 n# v; {, @
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.1 t* k7 }8 N( {* j4 [4 P8 P& y' B
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., E+ E, t4 z0 p( J/ U
 The interface should provide a menu so that the staff can:
[3 o/ I7 H* Y4 j7 z! ?a) Enter the names of the two Java program files to be compared
" a! f# |! a3 G* t5 K For this assignment, it will be assumed that the two Java program files are in the same folder as your program.2 B" ~* O |+ g& n1 P
** 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).
4 F5 u( r$ j) Q4 }) B3 uBSA104 Business Programming – 2007: Assignment 2- O c1 h: g* y2 G) H
Page 2 of 5
0 Q# X. L) }4 n. s4 Eb) Print out to the screen all the lines of code that are the same
" l& s( W+ }$ S$ w Include the name of the file and the line number of the code being printed for each of the two files
9 |& {5 e2 K2 U+ ic) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared! ]: [. f0 n5 W" T+ `2 q
 the name, username and department of the user
, r# G& }( i; X* x$ u: T3 X; n the statistics of the comparison
0 E8 K4 u4 ^# g7 k% J4 N- u- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
1 V2 ?9 q9 \) s* C( A- s the recommendation for further checking) `; p2 U" B& y$ W0 n
- 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 closely5 R1 F1 r7 @; d2 N
 the names of the two files compared! H* C0 G1 t$ i) v6 o. p0 ?
d) Leave the program (exit)
; j6 ~( }& ?; ]' y% t' k) E, FThe ProgramCompare class: (Total maximum 20 marks available)' h) ~2 Y/ y+ V4 X8 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)
& ?8 l: W3 R; e F- xa) provide an error message if the files are not found or there is a problem opening them
, w+ i \2 G# ^b) compare each line of code8 I( F0 K/ s9 n" H- j4 W: t$ k
c) print out the lines that are the same
; d" _; A$ W7 p) Cd) count the number of lines compared / lines the same
8 K q# u1 {8 m. |; y3 | zThe AuthorisedUsers class: (Total maximum 20 marks available)& [0 r! J) I7 v% ~! b" p, P
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)( I& X' p; F+ d/ A1 W( B
4. Provide methods to:
* T! S+ |9 a, U5 E; W) s/ }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, @2 [# [% k P! x; Y
b) return the name of the authorised user4 c% D$ h0 { L, Z! O, {/ D @
c) return the name of the department of the authorised user
. G5 t, x" c2 M uIndividual Data (Maximum 20 marks available)4 x. I' d# J, Z# ]: ^* }9 ^: @
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.$ k6 L% }; u7 Y0 A. _
Documentation (Maximum 10 marks available)
; a3 _( H. F0 z. b6. 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.
5 q) S3 y3 N4 y+ {: A! l7 I( a1 @BSA104 Business Programming – 2007: Assignment 2% _% M3 q2 Z) a" ?8 U% k
Page 3 of 5 |
|