|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
/ O; B' J! I V& u8 q/ kShanghai - 2007$ \9 N. \6 C& a% v [% c1 N
Assignment 2: A7 F. d/ Y8 y: ^; d2 \& C% t
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 e$ U3 q+ B8 i7 ]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.$ d* M) q% g- @
The staff must be able to:& o/ m- ~; ]) h
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 {( i% F; k6 d. B
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.
3 Y9 {3 K6 T7 f% P7 n5 ^ The interface should provide a menu so that the staff can:* ?, l1 V# e% w3 ?" D7 ^1 ~
a) Enter the names of the two Java program files to be compared
* v# w, a; _5 V% x. _# Z+ ^ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
- U s+ u0 P8 l* U** 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).
& [( O1 G% A+ qBSA104 Business Programming – 2007: Assignment 2
/ ~- n3 Z G* m0 ?+ `Page 2 of 52 u5 `+ _. O* E9 I) `+ x
b) Print out to the screen all the lines of code that are the same
l6 B& j& R b9 ? {2 o" L Include the name of the file and the line number of the code being printed for each of the two files ]( Z2 A+ k/ R- F3 S* p8 h
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared O' E! i4 E( e, X1 `
 the name, username and department of the user
6 n" w$ `. O8 [% \ the statistics of the comparison9 \3 b7 |) C: w2 l8 V: E; L
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ F$ a* E" {! i, G the recommendation for further checking, U/ @& P5 w4 [+ n9 W+ Y' ^% C
- 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
) H8 N' j3 }2 l4 m. V the names of the two files compared) X- }& }2 c, L- d) e
d) Leave the program (exit)
: V. `. V( d5 @The ProgramCompare class: (Total maximum 20 marks available)
5 O9 j, E: ^; h2. 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)9 E1 p# T0 |7 x4 O2 C
a) provide an error message if the files are not found or there is a problem opening them5 ] Q' ~5 M7 y4 e# m8 e
b) compare each line of code2 s$ o. Z# c7 p+ N, Z$ I0 H7 x
c) print out the lines that are the same- Q( A. i# I$ V
d) count the number of lines compared / lines the same E! J Z/ ?5 x; G) a
The AuthorisedUsers class: (Total maximum 20 marks available)* z7 T9 r( `0 \: X6 l
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)
. P, a+ g- l0 v, c2 ]+ e4. Provide methods to:5 s0 M/ P) N% J: R
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( A' n4 _! Q& `# I
b) return the name of the authorised user. a$ [% |/ a$ L+ L' `/ [
c) return the name of the department of the authorised user3 T+ i" B" P) _( I4 {. K' h
Individual Data (Maximum 20 marks available)+ I- D, N' S$ T: ?2 U) H
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.
6 x: P' T( R* z0 r0 d0 LDocumentation (Maximum 10 marks available)7 X3 {& l$ k- R+ R; v; 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.
. z' Y0 j2 A) u9 @$ u; ?( ?BSA104 Business Programming – 2007: Assignment 28 g3 u! M. C5 c8 ]( \6 P1 X
Page 3 of 5 |
|