|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming! [, T5 X7 D8 v: G" ?, ^
Shanghai - 2007
' R; ?0 ~1 n( u0 TAssignment 26 O$ _& K! n' g7 M
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): k0 U& Y5 M" \8 h3 U4 \
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.
4 o+ d' a/ b$ z3 V% u# b3 B: NThe staff must be able to:! G2 J2 g8 @" O; y, s
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
. T; L3 [* @# l7 z4 v- z h1. 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.
+ n( P! i2 p3 B) Z The interface should provide a menu so that the staff can:
, t* v' U. a6 f# D% }8 ?( m4 u9 Ya) Enter the names of the two Java program files to be compared
; b* J m+ B5 y7 @ m" ~ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
2 Y/ _( m3 O: I- Z$ h! C% z** 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).( V% H, N/ V' B. C% x
BSA104 Business Programming – 2007: Assignment 2
( A4 y8 R" v3 xPage 2 of 5
a3 v8 T% e$ V5 F: ?- Eb) Print out to the screen all the lines of code that are the same X( l4 D: U: e" U1 g) q
 Include the name of the file and the line number of the code being printed for each of the two files( r. V7 H$ T$ y% S( V
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
' F; u3 Q- g1 q. l5 e the name, username and department of the user
- t- i2 `9 ]; O6 y the statistics of the comparison- s p. {% f+ `1 f; P9 K" i" P
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
) e% p# M; t5 R+ t, I; S; N the recommendation for further checking
! B! q, V$ a9 ?5 w( a) l- 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
6 C3 b {0 Q5 f' ` the names of the two files compared
# B/ R* {- d" z; A7 Td) Leave the program (exit)/ J- _- ~7 d; e' C' y
The ProgramCompare class: (Total maximum 20 marks available)) ~. }7 @# X/ @+ C' _
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)
8 ?# o8 Y- q7 g( k" Ua) provide an error message if the files are not found or there is a problem opening them
' C2 a( r* Y3 i9 g2 t9 bb) compare each line of code
% Z6 @1 O/ R& ^6 Z; o, s" Nc) print out the lines that are the same
* W" B) ]& ]9 I# U/ Zd) count the number of lines compared / lines the same
6 S; }- A8 [6 w3 K' uThe AuthorisedUsers class: (Total maximum 20 marks available)
) h2 @, Q3 N& m& o& D i5 D3. 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)
8 D. v& I* A0 G; K4. Provide methods to:
, @" x( i' j+ ua) 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
" c2 j" {( D- D' |3 d b* z9 fb) return the name of the authorised user3 L2 T+ w$ f& V6 x! ^7 `
c) return the name of the department of the authorised user
0 p8 B; `& j' v y8 p- o( V" B2 eIndividual Data (Maximum 20 marks available) V6 o; L0 O, ^" {! `, v$ C
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.
% Q6 ]0 i0 A" i$ zDocumentation (Maximum 10 marks available)
- u* i r- |" \, \# j! G6. 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.
- g& O+ K _& V# k H0 u- j5 aBSA104 Business Programming – 2007: Assignment 2
, D5 q+ n G% o: TPage 3 of 5 |
|