|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ @1 N, p: {2 [
Shanghai - 2007
7 I* q$ D8 c7 m5 [6 Z+ Z' ^Assignment 2
& n" C3 d# e `! s; LDeadline 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)% F% I2 F4 x' U0 Z
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.3 D: b% }6 k4 T& U
The staff must be able to: U8 i. w: h3 G6 _" i2 ?
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
* N W' m8 s% }# Z7 |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.
+ O# ~- s/ i$ D- B6 x/ m4 g" Q! U* ~ The interface should provide a menu so that the staff can:8 I9 ^9 z0 P% x' k+ G4 X
a) Enter the names of the two Java program files to be compared3 ]$ g8 e; Z0 g' g
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
+ S) _1 `0 x7 {6 h1 _** 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).7 m w4 N9 n o9 V2 A7 S4 \; |9 C* Y
BSA104 Business Programming – 2007: Assignment 21 L3 i1 S5 t# G5 u. u4 I/ f) O$ m
Page 2 of 5
$ R; B9 T0 J! C, f! i: Vb) Print out to the screen all the lines of code that are the same: n0 Q, } i' |1 n2 e
 Include the name of the file and the line number of the code being printed for each of the two files4 ~! {5 R) y$ i# o. i" V
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
/ v# N* k. F/ y3 v* Y1 H/ k the name, username and department of the user
; B2 U. o3 _" |* a the statistics of the comparison
) e' E/ @. F) s- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
: q6 E; m8 R4 y the recommendation for further checking
# T2 w5 o$ a4 r; w! j- 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 closely9 P$ K1 c* A. A; [5 n( A
 the names of the two files compared
; C8 @# s' J& w8 Z8 l9 td) Leave the program (exit)
0 C; k3 b1 B) V% c+ n; Y# `The ProgramCompare class: (Total maximum 20 marks available)
$ B1 g8 w8 N0 T2. 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% @3 p9 j/ X" `4 Qa) provide an error message if the files are not found or there is a problem opening them _4 q; b( r+ S/ j
b) compare each line of code, W0 V% p( d% o$ o
c) print out the lines that are the same0 m; i& H8 r t1 e
d) count the number of lines compared / lines the same
' v. H5 q! X( D$ s2 LThe AuthorisedUsers class: (Total maximum 20 marks available)
4 Y, ^/ A% s: N; w7 c3. 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)- T8 m6 V, F9 z+ b
4. Provide methods to:
5 H, T/ l) h2 r! i' L! e- Aa) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match3 u6 c2 W; v8 _9 s8 w4 {5 Z
b) return the name of the authorised user
, k! z' O$ m6 d5 O3 L) P* Zc) return the name of the department of the authorised user
4 L6 C$ k4 P5 U- L* I5 BIndividual Data (Maximum 20 marks available)
9 l% G# R! _2 I1 B9 ~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.
4 ?# H& a8 q9 ~+ V" }$ tDocumentation (Maximum 10 marks available)9 N8 M) `, e/ w
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.
" C; M, c! r1 k. s6 l. H+ l, t/ Z+ {BSA104 Business Programming – 2007: Assignment 2% @/ [$ z) v, @: \
Page 3 of 5 |
|