|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
9 j c( E4 C/ B* J2 }+ H, i5 `Shanghai - 2007
: M. [# d" L8 F; A% ~4 s. E0 ?Assignment 2! N$ a! g8 d9 b6 H& J; i, J
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)1 ]9 A, P5 d9 T' R
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.
p& [4 u+ D5 Q9 i7 [" `2 `The staff must be able to:9 h" `2 h# O" ~) R8 j: [
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
$ r8 n V% O0 O" e1. 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.
) ]% n4 m; L7 S* v/ X N: a9 | The interface should provide a menu so that the staff can:
" i& D) B% l7 v' ]' a" da) Enter the names of the two Java program files to be compared
, L. B0 y( ~0 F* ~6 t For this assignment, it will be assumed that the two Java program files are in the same folder as your program.1 ^- D: t/ ^8 d9 j
** 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).( ~5 k# S D _5 @6 V! s7 F
BSA104 Business Programming – 2007: Assignment 25 Z' i% ^% U b$ n& K6 d
Page 2 of 59 z. T S5 O( R2 ~
b) Print out to the screen all the lines of code that are the same8 Z9 F. O% l9 `7 s7 g) ]4 N: m
 Include the name of the file and the line number of the code being printed for each of the two files2 D3 }+ j- p: |( Z3 S
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared! I& Z3 ^& f* d' @" i5 O" `
 the name, username and department of the user9 [) [8 r' r5 R# L
 the statistics of the comparison! _8 x/ _' o. x5 A2 R
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different. O1 M9 H! Q' t7 [( R, ?
 the recommendation for further checking" F8 ^. e! G# I
- 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
. C7 s# U& x0 } the names of the two files compared
" w" \% m4 b" r8 ~- ld) Leave the program (exit)/ E, ^9 w0 t0 L$ a, `% E
The ProgramCompare class: (Total maximum 20 marks available)1 i2 h. Q. ?9 V, b3 m( @
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)3 \6 d0 B, ~* G
a) provide an error message if the files are not found or there is a problem opening them3 L& @& s. U) T- s
b) compare each line of code8 F! \5 |5 \. Q( [% l; O% T2 W
c) print out the lines that are the same9 k0 w/ |0 q* u7 H. V- {+ t/ m, s
d) count the number of lines compared / lines the same
( Y9 D3 T8 [6 G8 k& N# i6 B- L, ]The AuthorisedUsers class: (Total maximum 20 marks available)4 e% g# G/ z+ F8 L; o$ v" k. R( h
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)
/ ^6 b+ q+ m# e4. Provide methods to:+ v% ~- U+ ]( R. }' 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
7 v2 j3 p- P2 P9 k8 j) P' W2 Bb) return the name of the authorised user1 ` q* Z* N7 t0 G2 N" n& X
c) return the name of the department of the authorised user( K# r8 i; |. S9 E6 ^
Individual Data (Maximum 20 marks available)5 r# ^- i( ^* \
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.# c0 N) w7 q1 R( _3 o
Documentation (Maximum 10 marks available)
# b. r5 B1 {- L% _/ Y7 h6. 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.
! W4 ?' g& R9 G: X7 bBSA104 Business Programming – 2007: Assignment 2
7 p- K- }* d* I4 XPage 3 of 5 |
|