|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming' }7 m3 d) A3 a
Shanghai - 2007: u+ S& s9 c% {/ r
Assignment 2/ O: u3 M u0 }7 T3 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)2 U% G/ M% D2 M5 g# S( w: 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.& C" b( B w" s3 u0 [
The staff must be able to:
4 O6 {& b- Q% N Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
; M. |9 b% K5 E1. 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.
8 J1 H! I# b7 ?3 H% }+ A) d7 \ The interface should provide a menu so that the staff can:1 |- M" v$ E7 K+ w& u+ s2 H, ?
a) Enter the names of the two Java program files to be compared
2 T9 m4 o4 J" t For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
* q4 g2 S+ C- C- h7 w4 d6 \8 t** 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).0 |' B/ @! b0 P$ ?4 N4 A5 B5 \+ ~) t
BSA104 Business Programming – 2007: Assignment 2 X0 P; G2 n1 I9 i% ]7 s: K1 W, t
Page 2 of 5
( {& G. v; |; i0 R( Wb) Print out to the screen all the lines of code that are the same- O+ v- K z* e/ J ] W
 Include the name of the file and the line number of the code being printed for each of the two files
! N+ F' @5 G' M) o* D7 Yc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
/ Q( t$ H* W: J6 b) [2 [ the name, username and department of the user
$ w! [( i6 {! g& y) o5 Q the statistics of the comparison6 k0 q- T) `- @
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different( H0 F/ l' `- s
 the recommendation for further checking$ @7 `) l/ x) o7 j i
- 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
2 ]1 L& S$ \! f; C the names of the two files compared
5 P; H" ~) g$ V1 E$ N& n, j5 ud) Leave the program (exit)
1 }3 } y$ @$ D( O" HThe ProgramCompare class: (Total maximum 20 marks available)
; O- M6 B+ Z. U9 d. h( Z: }, ~3 F8 |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)
" a2 W* w( {9 j0 m- O4 E4 va) provide an error message if the files are not found or there is a problem opening them
9 @+ V0 G3 U0 i, L9 |/ m6 k& ub) compare each line of code
6 P! V) i: g+ r: J7 Zc) print out the lines that are the same
7 z. ]3 o' `/ p8 f8 s: K' wd) count the number of lines compared / lines the same
0 \ A. y. s7 y+ i5 _" l+ JThe AuthorisedUsers class: (Total maximum 20 marks available)$ x6 Y/ G: _4 I; h, L: g R1 d& b) S
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)
- X* }5 p& q. o, P1 I' F4. Provide methods to:
, e8 l) Y2 L! `3 C" o9 [" ^) ka) 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- x# X' e( `) v- ~
b) return the name of the authorised user( I0 W; R- D m% R6 O O/ ^
c) return the name of the department of the authorised user
) L# u: Z* Z, b1 UIndividual Data (Maximum 20 marks available)
9 V. ]. U, |4 b5. 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.; W# m4 Q+ ]2 ]& ]& Z0 T
Documentation (Maximum 10 marks available)
7 O( v3 S4 o- r/ q6. 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.4 n- j4 ^9 s6 e# i* c; K& m
BSA104 Business Programming – 2007: Assignment 2( N% D. i9 s- b x& K8 {3 Y- ^1 b+ x' V
Page 3 of 5 |
|