|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
) t, c. m+ t) PShanghai - 20071 r4 i8 J: B$ G
Assignment 2/ L- G: m0 S9 n7 x) m3 k" d
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)3 l! h. H$ P8 E7 }5 @) {9 q
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.+ o$ B$ T; E, ]$ K/ M2 ]+ |
The staff must be able to:
1 J4 ^! p6 w! ~$ C2 q q Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., E" D; j; U* q v, ~) O3 Q
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+ o1 R4 b4 d: ^9 } The interface should provide a menu so that the staff can:
3 S1 h5 ?1 Q$ Wa) Enter the names of the two Java program files to be compared
% H6 ~9 }# l4 m# d For this assignment, it will be assumed that the two Java program files are in the same folder as your program.* Q; B8 W% S" \; V6 v" 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).
" a" ~) b% X' i: I# RBSA104 Business Programming – 2007: Assignment 2
8 z! c, W2 j8 i8 j$ O% B& m- B& qPage 2 of 5& J. d* r' i& \2 J6 D
b) Print out to the screen all the lines of code that are the same
9 J+ l- y; ?/ {- S Include the name of the file and the line number of the code being printed for each of the two files
& L& Q' ?3 \* _- e- xc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
7 d& T2 u( F/ q the name, username and department of the user) z0 H8 K8 q2 u( X% t( N
 the statistics of the comparison
* D/ ]# F5 J. {5 R5 {& [- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
( ]0 [0 `4 a* F# A# S5 _ the recommendation for further checking9 Y" m# h2 i. r7 {8 y! `0 @
- 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 closely1 H3 H# C. R& N3 `
 the names of the two files compared+ U) `3 i4 s9 J& c& f
d) Leave the program (exit)
0 Z1 b4 S: ]; {, ]/ ?The ProgramCompare class: (Total maximum 20 marks available)/ G% o$ u+ Y& P
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)
) [: Z; d! S! e4 }7 Ha) provide an error message if the files are not found or there is a problem opening them$ P$ t: c& E( V% H
b) compare each line of code
# G5 I2 a5 V! s# Qc) print out the lines that are the same/ |6 z: s! H& t. [- S6 I
d) count the number of lines compared / lines the same
& }# l/ m) j- xThe AuthorisedUsers class: (Total maximum 20 marks available)" z1 k1 M; |) a0 U7 {; Y$ C7 Y `
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)
" U2 C5 I K+ n6 _+ Y: _4. Provide methods to:
* D( q: B. i9 w$ x( N5 Qa) 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
0 E0 {+ }8 a- }( ^4 pb) return the name of the authorised user% E8 _+ P( y' g& \2 s6 U0 ]8 `
c) return the name of the department of the authorised user
2 ]# C2 _5 | ^( V! n+ k4 WIndividual Data (Maximum 20 marks available)
$ O. P' @1 Z. P- m3 t" w5. 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.
4 t8 }* L0 r& [Documentation (Maximum 10 marks available)0 U! ~( S) |7 i- N; I: j
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.3 x. ?* p8 j e6 ~
BSA104 Business Programming – 2007: Assignment 27 ^) ?% a4 x. C3 ?
Page 3 of 5 |
|