|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming) z. X) P1 M, r! O- _
Shanghai - 2007: `$ ]0 G( x* R! s) C
Assignment 2
4 p& h: m1 X: U0 B. s9 @. Z& {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)
7 J$ j x% J/ `8 A& S) l( v1. 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.
1 A( P4 F E6 f I. JThe staff must be able to:
3 x! g* B I. U2 w- t5 L( a, E4 \ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
: Y1 p- J% ]2 U: s1. 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.) I# D. x# \( s/ R6 D! ]- G8 q1 Z" `
 The interface should provide a menu so that the staff can:8 V% D, J5 s2 x& O0 e. R
a) Enter the names of the two Java program files to be compared
) u. x; a, a1 }4 |* g9 e For this assignment, it will be assumed that the two Java program files are in the same folder as your program., r8 g% p( u5 G- A
** 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).
" b" \ h! N1 {BSA104 Business Programming – 2007: Assignment 2; {+ G" ~" T4 b
Page 2 of 5: W/ e* g0 S4 ]) B6 R- g2 `
b) Print out to the screen all the lines of code that are the same
& T+ `% t0 ]8 K6 A9 }" [: Y8 E Include the name of the file and the line number of the code being printed for each of the two files$ r5 [* s x' |+ Y1 @' u
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 w9 n* `; z- n/ `& v; k; D the name, username and department of the user
1 s3 s3 M/ G" k1 ?7 j0 n9 b the statistics of the comparison& _8 ?9 J& M* s! A' t
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different% v: v+ x3 W' y
 the recommendation for further checking4 U! _- d/ h+ |# u& M( L
- 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 closely4 n3 r+ n% r J, Q" L9 X
 the names of the two files compared
) s9 ]+ P L7 j& M0 m+ @& id) Leave the program (exit)
; T' J+ T( }+ G! q& P! aThe ProgramCompare class: (Total maximum 20 marks available): o9 C+ C J' |, u F
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)7 ?. J9 V. K* j) J- O/ M
a) provide an error message if the files are not found or there is a problem opening them/ _" D0 }8 V' i6 y1 U+ S
b) compare each line of code
( j5 c" |8 o/ ?" B, O2 z. G; Tc) print out the lines that are the same
/ w# K' ?) T8 ~- fd) count the number of lines compared / lines the same9 O" O/ d. \( r4 G& a& O
The AuthorisedUsers class: (Total maximum 20 marks available)1 q7 ]+ D! x1 o j# i: }5 |
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$ `" s' q( N" ]
4. Provide methods to:/ K5 W" J- V+ 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
9 M# i5 ?' u; ?6 M qb) return the name of the authorised user) p( A! G' a; J3 a& E: F
c) return the name of the department of the authorised user
; b# m" ~+ i" \5 S) z' h7 c+ s6 V dIndividual Data (Maximum 20 marks available)2 W( Z" x" Y( L- E1 M, |4 \4 o `
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.# F4 O) Y Z5 Z! P3 J" j
Documentation (Maximum 10 marks available)
* ^* s7 n! ?# Y" e1 b. C6. 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." N3 q2 B9 |- ^9 M2 Y- S! Y% r: Z
BSA104 Business Programming – 2007: Assignment 2; h/ x7 a4 f8 v' z$ O) ?* Q
Page 3 of 5 |
|