|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# z$ N7 K' |! I+ } O3 d( YShanghai - 2007
. z S" A( j; gAssignment 2( O2 C) _3 {8 M9 e$ ~+ G
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), [1 g) Z. h6 f: o% A% Q
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.7 c# h7 [+ n' b1 L: r
The staff must be able to:
* Q6 Q4 t8 F2 ?) x+ l Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
- z w/ d! `0 Q1 T2 M1. 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.
8 A. D# h# K' x The interface should provide a menu so that the staff can: f) `8 ^$ p# C' T' t* ?3 q8 T
a) Enter the names of the two Java program files to be compared: f, x1 f+ r ~7 W
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.5 N: ^+ w" e* e0 H. Z0 W) s
** 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).
( d+ p" B w. W6 p3 e8 YBSA104 Business Programming – 2007: Assignment 2
/ {% V0 s/ d/ @; I. qPage 2 of 5
% a# t! V( C( j+ O1 L, Z5 Nb) Print out to the screen all the lines of code that are the same
% I* C) }: n7 i" d Include the name of the file and the line number of the code being printed for each of the two files; \' z& B9 Q$ _! I* e1 l) Q
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) e j! M0 u: R- k: @
 the name, username and department of the user+ o; ] e- _* ^. [6 |
 the statistics of the comparison
, }8 a. M8 S; g! |6 E- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ g: x! C& p: E1 w! ~) C2 Z, q! V
 the recommendation for further checking! Y7 v3 }8 C4 \
- 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
* [3 [7 |/ N% x! q the names of the two files compared
9 N1 b) U! R0 A+ }, d- M8 M, u; b7 `d) Leave the program (exit)
3 z7 p' _% X- ^6 eThe ProgramCompare class: (Total maximum 20 marks available)
/ a7 M- R- h- ?; E f/ V- t9 _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)0 ~9 E9 o4 X' M# L
a) provide an error message if the files are not found or there is a problem opening them
; O8 h& s8 _& V2 h3 n# H5 Ab) compare each line of code
6 D9 r; J' Q9 t/ qc) print out the lines that are the same. g5 e+ d; x9 D9 p' S
d) count the number of lines compared / lines the same% S0 r5 c$ B3 ^( y! l
The AuthorisedUsers class: (Total maximum 20 marks available)
8 Y' `- }- o+ B1 P3. 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)6 B6 \- U( x* C! g9 h h7 I+ p+ q5 u
4. Provide methods to:
2 r7 _2 {. f3 Y. B9 @- ra) 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
; c4 @7 J' D' b h& Eb) return the name of the authorised user
8 P* E" v3 }* N3 V# N% R9 Pc) return the name of the department of the authorised user: R- E" M$ J& W4 A' |, {7 ?
Individual Data (Maximum 20 marks available)
# Z" k7 f0 L5 [0 T. e. a- r+ D5. 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.
* A" n& {+ b) L, P ODocumentation (Maximum 10 marks available)
$ t& V3 }8 e0 M* 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.
3 E9 b# d$ |4 I$ q7 b; yBSA104 Business Programming – 2007: Assignment 2
0 q+ ]7 [+ [& E- t- Q7 ^" sPage 3 of 5 |
|