|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
7 q U/ N8 ~ n" n; qShanghai - 2007
" y. S# i& L( V4 e0 s4 S* ]Assignment 2
* d7 \: j! c" ~/ E: d# tDeadline 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)
/ d: L& D/ \! m- ]" s1. 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 G' H. O% f( ?5 R# i0 y0 u) UThe staff must be able to:0 Q* {. x) W" N
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **. _# S3 p+ z' H9 \
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.4 t# ?; m M5 a4 Z# B6 i& z/ g
 The interface should provide a menu so that the staff can:
, w4 Z1 L: j& p! V8 Ma) Enter the names of the two Java program files to be compared% |6 O6 R. n# n
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.' i" S2 b3 N9 G1 {. ?
** 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).
, v1 Z ]0 n" t# P, p- i7 f# C1 [" lBSA104 Business Programming – 2007: Assignment 2, ~% @% w/ t. Z8 ]+ r% o" C$ [
Page 2 of 5
( e8 {: d4 i1 y& c% J% s% ^, ?b) Print out to the screen all the lines of code that are the same
2 q9 X1 k# K4 \1 ` Include the name of the file and the line number of the code being printed for each of the two files
8 F; u8 |: R9 m$ D8 r% w x! fc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; t) M7 ^3 W z9 k3 ?8 o the name, username and department of the user, n( p$ d* e+ B
 the statistics of the comparison+ M0 h1 M* |/ P2 T
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
" i$ Y# z' ~. p* d the recommendation for further checking
2 v/ M8 _+ s. G! w- B5 G* M( N' ?, v- 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: d6 n: W {3 _; o0 O
 the names of the two files compared
) D% f# R9 D ]d) Leave the program (exit). k* b6 ^& i9 ?2 b. W/ U+ b
The ProgramCompare class: (Total maximum 20 marks available)
/ {! \; \0 |+ y5 ]/ j& X2. 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)! s& a2 K' Z3 F3 q% F
a) provide an error message if the files are not found or there is a problem opening them8 b3 e# S7 e t' ^( i$ `$ F
b) compare each line of code2 j: i8 |, x% O
c) print out the lines that are the same
& m0 Z+ k |9 E9 L/ q) J. f: pd) count the number of lines compared / lines the same5 i/ D# \' c3 a$ |, r
The AuthorisedUsers class: (Total maximum 20 marks available)
& _1 _+ @% g1 E Q( _" \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)) b6 e9 V, I6 R
4. Provide methods to:# C+ j9 c" R" a* f2 y
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% H1 K4 B- h4 `9 A8 e9 |; G
b) return the name of the authorised user
0 y8 G. T* i6 h6 _) W" K. d2 |c) return the name of the department of the authorised user" [8 u" L- B5 P. _7 S& l5 R& P
Individual Data (Maximum 20 marks available)
: Q+ x2 ~: c0 r2 W- |4 a4 [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.9 r/ u3 n7 [3 i, e% X1 J; E* a5 q
Documentation (Maximum 10 marks available)
% Y+ O+ q. ~7 _6. 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.
# n& E3 t$ ]8 e, p7 `, SBSA104 Business Programming – 2007: Assignment 2, M( Q9 X# y* W* K* @# q
Page 3 of 5 |
|