|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ J L! j1 q8 F: F6 U2 c1 d `% E
Shanghai - 2007/ e9 `& i2 A8 T7 y
Assignment 2
% Y4 m3 {2 x V g$ xDeadline 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)" O, c# z2 L3 b2 \6 ^
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.' w% g. z9 C! [( M8 z, F
The staff must be able to:& Z* p+ G/ p7 V& S
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., K0 ]1 b; U! g. n. P
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.
) x+ q; L" S% U: c The interface should provide a menu so that the staff can:5 t& o6 r$ g2 t
a) Enter the names of the two Java program files to be compared
: [' m A5 ]' D5 T# W Q! m For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
8 Z; `& k! W5 B" e& F! V: x3 i- u/ M! {** 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 @/ U/ Y4 A' U9 R
BSA104 Business Programming – 2007: Assignment 2
. q, |) q# Z; j8 n3 N! ~Page 2 of 58 Z1 g4 j; W8 j' V' j
b) Print out to the screen all the lines of code that are the same0 d6 Y) Q/ q& V
 Include the name of the file and the line number of the code being printed for each of the two files
* c; B: x) v6 S; o* O" Jc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared" `8 }8 x5 V0 X1 C
 the name, username and department of the user
6 M) U0 \5 e5 A) D' S* f2 n" D the statistics of the comparison3 ]2 b O4 k& i2 a" K& k! R* s5 M0 {
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
: r' E: S+ n7 ? the recommendation for further checking
; B2 t, a$ u4 m& I" S) T0 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 closely9 \5 B) M, G3 L! O+ w4 d/ Y
 the names of the two files compared
: \7 Z) [9 H9 E+ L% Z$ Cd) Leave the program (exit)5 E; z+ f6 U( A$ C
The ProgramCompare class: (Total maximum 20 marks available)
" t/ y) y4 {3 E2. 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)6 r" K# L9 {0 R7 B6 s% \
a) provide an error message if the files are not found or there is a problem opening them
# C# Z. Y& z( }# gb) compare each line of code& ^$ w4 F* ~: Z4 ?$ ?7 A! L
c) print out the lines that are the same
4 x1 |. g5 C' P% Rd) count the number of lines compared / lines the same, O% {$ \. l. R. k
The AuthorisedUsers class: (Total maximum 20 marks available)$ P/ {) V# C9 j0 `6 O) {, b3 o& k$ P- a
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)1 Q8 B8 e( A9 p5 ]
4. Provide methods to:
8 Z2 `5 x; e# K( Ha) 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; s- {, P/ ^/ ]: t1 ]+ p
b) return the name of the authorised user
3 z- h8 }1 m1 [0 Jc) return the name of the department of the authorised user. G; U& F9 s9 O0 Z8 t4 O8 k! l
Individual Data (Maximum 20 marks available)
/ I1 C) L8 N) Y$ ^/ e5. 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.
" W( J+ X3 E: r/ K5 LDocumentation (Maximum 10 marks available)
3 i4 V5 c% G$ M% Q6. 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.
6 q9 _: C3 V2 y2 E, tBSA104 Business Programming – 2007: Assignment 2, u. H& h3 ]$ u: @( P
Page 3 of 5 |
|