|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming2 a! A* o$ o( A
Shanghai - 2007$ V, z. R+ O2 l2 q. Q. d
Assignment 2
' ^) ^; a; K# D& y i) }% k- u7 sDeadline 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)! c6 a- o& r. t) g
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.
- l, [0 l6 y# e( U: |The staff must be able to:9 M+ ^8 i V/ j1 O8 f8 `3 o
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
6 Q' i3 i0 \; c' ~: _1 w4 G1. 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.
( _ G( _5 T4 Z/ `! U8 v The interface should provide a menu so that the staff can:5 N% j& _! M. z+ J
a) Enter the names of the two Java program files to be compared
3 `9 h2 m/ }, U5 c For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 x. I/ d) R! h' M& d
** 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).
! o& p( d/ n8 i( [* p5 _BSA104 Business Programming – 2007: Assignment 2
4 w% `" {8 ^) `Page 2 of 5
0 L& Q* {6 i) J# p1 s( j% O. X: Ib) Print out to the screen all the lines of code that are the same
% F8 I% Q* W3 i) ?$ j# ]: x Include the name of the file and the line number of the code being printed for each of the two files
! W+ Z% W$ K5 A+ qc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared' \4 i* n* Y2 ^7 b) X' W) D
 the name, username and department of the user; X1 d3 Y+ r! P; ?
 the statistics of the comparison" N0 x' ?- U& v/ A/ O
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different( V# k" v, |1 j! @' @$ \7 ~
 the recommendation for further checking
. z8 c# s' f6 R( t6 }- 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" Q- u: m: ?3 ~" ?) y
 the names of the two files compared8 ]6 {2 ^8 x( V4 A( i/ q2 B
d) Leave the program (exit)
7 o8 p0 y9 D% j# t( qThe ProgramCompare class: (Total maximum 20 marks available)
" d7 h8 \9 z6 M& V2. 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)% i a# y/ R P: s
a) provide an error message if the files are not found or there is a problem opening them
?( k4 K, {! o. {% Gb) compare each line of code
( u: [% {9 {$ W1 Nc) print out the lines that are the same" ^ g* l- O0 M" O' [; M6 y8 E
d) count the number of lines compared / lines the same* h' I) c" F2 e9 o( p) C* @1 k' K
The AuthorisedUsers class: (Total maximum 20 marks available)5 s. d& |0 E* J8 M
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)# v5 d+ m$ F |8 t
4. Provide methods to:
0 M' X! |% Q. f! i# x3 ^! Za) 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
- @# S- `. q" S, _3 d; o( A! @) t7 Rb) return the name of the authorised user8 \1 }! {9 L* V7 q% b+ Q
c) return the name of the department of the authorised user
7 \7 ]4 s0 r" N+ gIndividual Data (Maximum 20 marks available): S0 K' @# U: h( X% y, q' @) R
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.
/ Q/ Z" J, Y/ D1 mDocumentation (Maximum 10 marks available)
6 D- d4 y7 w! R( ?+ f i6. 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.% ^! S$ m, A) }( U" A0 ?, D
BSA104 Business Programming – 2007: Assignment 2
7 u- \7 n7 d! ^8 l4 R9 XPage 3 of 5 |
|