|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming0 ]5 ]5 v6 h5 p! X5 U; _
Shanghai - 2007
& E( w$ z R3 \! K% T4 zAssignment 2
; p1 W/ l" P9 _$ R* _) O" |5 ?; `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)
' c$ @$ I8 B$ h8 A7 C1. 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.
2 f6 p" i A, o* ]' x$ ]) JThe staff must be able to:* ^6 i! O8 ~4 k! }. }* J L2 e T. E' h
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
# O7 n+ q( p9 z1. 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.
, s. r& t* R8 K* { j The interface should provide a menu so that the staff can:) I3 o" o7 W) o$ y
a) Enter the names of the two Java program files to be compared0 V, O" f6 p% B. @) g; ~5 E
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 A0 E$ r) f" |; r** 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).
" ?2 _7 s7 z+ i/ X0 QBSA104 Business Programming – 2007: Assignment 2& z; a5 B+ q$ ?( |, B3 V6 m
Page 2 of 51 Q2 u8 K' y ?7 y, V
b) Print out to the screen all the lines of code that are the same
" D5 U$ O. i! ?' u. t Include the name of the file and the line number of the code being printed for each of the two files$ F& [# t L5 G. `; b4 j
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared& E" ]/ s) B! a9 D+ [
 the name, username and department of the user9 P0 h: ~1 b* y" z! U. v# F* p
 the statistics of the comparison8 W. e8 l8 ?! W3 O( ?4 e/ w
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
3 R V# j; ~3 j the recommendation for further checking
. T& A, E+ u* N. r7 V4 {" X- 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+ X8 x% E! i7 o" I3 M
 the names of the two files compared6 g# r, D: R' q0 Z& ]
d) Leave the program (exit)
/ ^; t8 b$ t7 rThe ProgramCompare class: (Total maximum 20 marks available)" y% a/ K4 z6 }
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), `& B! I4 _8 ]
a) provide an error message if the files are not found or there is a problem opening them, J, i, \2 D$ P- {
b) compare each line of code2 Y0 p/ I7 o; e Z% w0 i2 i1 q- k! E6 v! P
c) print out the lines that are the same
7 v9 {' U: H% bd) count the number of lines compared / lines the same+ w* E$ h3 _8 P. N. w R
The AuthorisedUsers class: (Total maximum 20 marks available). B; D+ v( l) 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): }: x! q/ ^( X! A% ]
4. Provide methods to:, l6 q1 k1 u/ [
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
0 D( ~8 N" v* C& @+ ab) return the name of the authorised user1 G/ M( A6 l! B" a0 B ?" A, r2 @$ B
c) return the name of the department of the authorised user
! d! n$ H% ^! AIndividual Data (Maximum 20 marks available)' z" k N. I, B2 O$ f- }
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., C, Y, f1 }% w0 ]8 G
Documentation (Maximum 10 marks available)
- s! |6 c- c+ y0 H1 J( P6. 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.! N* _3 D. K% w4 H( ~
BSA104 Business Programming – 2007: Assignment 2) F3 L1 I- N* j3 L5 k1 L
Page 3 of 5 |
|