|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. {" |/ @" I8 p
Shanghai - 2007
/ J6 z8 K0 }& E# MAssignment 2
7 B0 G3 U1 y+ {# GDeadline 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)
2 p- E }; W% z* W) {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.
2 }4 f( s9 {- p$ @+ n: fThe staff must be able to:
$ L! v* U5 T# q: c% I2 ^8 @- y0 o Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.4 m- c8 w0 y& d# R
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.
* S: t( Y0 m) O1 [% n The interface should provide a menu so that the staff can:0 T2 Q# l. |' F+ O7 T o3 P5 {9 f
a) Enter the names of the two Java program files to be compared5 \) O2 V9 }# X! v/ D1 v$ b
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.+ m z3 b/ j. j+ h* }
** 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).
% p8 i$ M& A7 l" X" u# ^BSA104 Business Programming – 2007: Assignment 2% W% }3 k3 V; c3 a( P! [
Page 2 of 5/ u, U$ G2 Z6 |+ n' a& Q
b) Print out to the screen all the lines of code that are the same
I; n& r7 k- Y8 Q! J2 {" P Include the name of the file and the line number of the code being printed for each of the two files
, j8 W( P) Q: P" n Ic) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) M" f* w0 m7 w$ H0 V6 x; m
 the name, username and department of the user
1 ?* o0 W7 N+ H" H the statistics of the comparison( ~" K0 B0 R# n; y
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ h9 `6 }" [, {3 d the recommendation for further checking- I' G; x/ ~2 W+ o4 B5 O) n# H
- 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
0 y; @. e* R1 G- _* B+ e \ the names of the two files compared
0 h1 w2 j) J6 n; P# \ G3 _' ad) Leave the program (exit)
. ~. p( Y( ?" N9 `7 A6 [The ProgramCompare class: (Total maximum 20 marks available)
, r* ~2 t7 a1 W* q! G: p2. 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); f: T% Z3 T4 s6 V8 p
a) provide an error message if the files are not found or there is a problem opening them# `7 [: k6 j+ g# s
b) compare each line of code3 a& M, s' p# G1 F
c) print out the lines that are the same
d/ }& c5 |+ q; m6 u0 c$ x: u4 {d) count the number of lines compared / lines the same
3 q! @6 a4 D1 CThe AuthorisedUsers class: (Total maximum 20 marks available)
% @& I! a' I$ e3. 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)
9 `# [# Z; C- r' x4 r, ?! e9 V4. Provide methods to:
, @ [8 W" l2 H# }8 ua) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match8 l, ?% G6 `) D3 z
b) return the name of the authorised user. k" `$ b3 j% u; Q8 c
c) return the name of the department of the authorised user
3 ^; ]: R6 O/ @ [; q, I: RIndividual Data (Maximum 20 marks available)2 z6 Z" y% W5 @8 V
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.
8 }) H: @2 P: F( |/ f% A0 @4 NDocumentation (Maximum 10 marks available)5 B( v& u5 m+ a, @# T
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.
" ?+ } q# d _2 N+ d: ^BSA104 Business Programming – 2007: Assignment 27 K- e% ~" t% q3 @/ A6 ?+ M
Page 3 of 5 |
|