|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming e6 s( L& b7 X$ ?
Shanghai - 2007, O1 h% _* H6 ]" D* O" U+ l* t, J! h
Assignment 2
7 M- r# W" X) M- l6 FDeadline 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)
+ e5 |8 i5 R: O8 R# |% q/ l1. 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.
9 d! Z* @$ ]+ }# ]7 rThe staff must be able to:: t* }: n0 W l$ P" X9 [
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
6 N* N$ n& Q+ ~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." c2 Y6 g5 S: j9 U. x
 The interface should provide a menu so that the staff can:' V6 |6 N0 k: e: T( k( h
a) Enter the names of the two Java program files to be compared
9 S9 I+ V' Y$ A% o) J* V+ t% x9 N4 ~ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
3 L5 F6 H1 z6 D8 b7 h% M: D9 |6 b9 v** 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).
9 ~) ]2 [* h5 V) K$ TBSA104 Business Programming – 2007: Assignment 2# F# @% Q& B" F" T
Page 2 of 5: u4 O- R) t/ O m I9 S# U
b) Print out to the screen all the lines of code that are the same
, s' S/ e" C) Z, V h: R3 r/ p* h Include the name of the file and the line number of the code being printed for each of the two files! q2 ^1 M" e' h
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
6 Q( n& p% n$ W, }7 i the name, username and department of the user
2 ~' }8 [' Y, C0 V* N the statistics of the comparison
3 J5 R; }( k9 X: G# i- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different5 @3 q/ M6 @ k; N, K m
 the recommendation for further checking3 @. o5 C( |1 l% F' `
- 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
/ a' U' R% y* ?5 N' Q4 y9 C the names of the two files compared
+ H3 B" s+ G+ h1 {d) Leave the program (exit)
; w! J- ?* j/ K* I Q# OThe ProgramCompare class: (Total maximum 20 marks available): C& p( P8 W; ?; V5 n
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)
, [. y3 N: \$ e- n0 c9 Z; ga) provide an error message if the files are not found or there is a problem opening them
s" Y8 T5 A# a$ {, Gb) compare each line of code
: i) l2 ~9 x! Rc) print out the lines that are the same
9 p; e) d! e. B- g" xd) count the number of lines compared / lines the same
) |$ o# Z% A5 `. s, `# S R2 QThe AuthorisedUsers class: (Total maximum 20 marks available)* z6 u' D: b2 A3 ^% Y# C8 {
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)0 z* S: q: S6 H M
4. Provide methods to:
/ a7 a( @: j; {# \3 U$ Wa) 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! o& n6 M0 x; W) ^! ]# Y5 F
b) return the name of the authorised user! _4 N% D2 A$ A) y9 ~2 j" H8 |
c) return the name of the department of the authorised user
# D# Z4 n2 R8 f+ V( RIndividual Data (Maximum 20 marks available)
; [4 {4 W ~! g5. 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.
# S$ b2 Z% m6 ^3 _4 RDocumentation (Maximum 10 marks available)/ j4 S; A S4 d" ~' c9 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.
7 f, {3 x$ V- b* K: B# nBSA104 Business Programming – 2007: Assignment 20 R5 T5 c$ h ^
Page 3 of 5 |
|