|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
5 B7 @+ k; X' }& d& ~* b6 ~Shanghai - 2007
) B4 W. b: `6 U g. W H# v) SAssignment 29 }# y3 ^! C5 p6 K4 h0 a8 o
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)3 r7 i) L- y: ]2 p) K7 f( v( h
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.# A8 ], J7 w! x9 g* j
The staff must be able to:+ y+ a9 K$ r$ I/ a7 ~- c% x
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
) X. d; l3 |/ @! _& 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.2 [, ^# q$ I4 v F
 The interface should provide a menu so that the staff can:' Q0 ]' P2 t" H! U8 A/ F
a) Enter the names of the two Java program files to be compared b6 H: n( j9 `
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
2 v; x; W) w$ C** 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).
( t s# I1 X+ C) `. z( K8 d% U4 FBSA104 Business Programming – 2007: Assignment 2. F1 l( D3 S4 \( P' V
Page 2 of 5
{5 H4 r g2 ?$ U7 [6 \% ]b) Print out to the screen all the lines of code that are the same
1 c/ N: D3 H; i2 W6 U Include the name of the file and the line number of the code being printed for each of the two files$ F; E( Y" f6 V
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared* ]# f. p( t! d! e f
 the name, username and department of the user' j2 s9 m h& J+ Y4 s$ @
 the statistics of the comparison5 A O" o' f. M* H/ g% a
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 S e, Z8 L) a( E+ ?/ Z* Q the recommendation for further checking9 L1 c! b$ r3 d
- 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
; J F) h) x/ n% M; { the names of the two files compared" u. o" E, t7 Q3 e/ Q
d) Leave the program (exit)& E" N$ [. @ |0 f S4 E
The ProgramCompare class: (Total maximum 20 marks available): E. L2 C) s# X4 \" y/ I' F
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)
* o/ e% v. A+ X; i) ~a) provide an error message if the files are not found or there is a problem opening them ^* s( ~) o( d5 }$ `
b) compare each line of code
% b, z! K; G( ?. G3 h! f6 u/ Xc) print out the lines that are the same8 y2 c5 O: O5 g! W! a
d) count the number of lines compared / lines the same
% Z7 z4 o; c2 U! h- h3 l+ GThe AuthorisedUsers class: (Total maximum 20 marks available)
2 @6 ~* e8 n% X& S3. 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)' E4 o! E) x) ~) Y
4. Provide methods to:
! `9 _, w4 V- B# V+ s) n/ n% 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 match
5 n* q8 d) M8 U+ ~( l5 Z2 Eb) return the name of the authorised user
7 m* r9 }" b7 k/ r5 ^! p+ d3 Sc) return the name of the department of the authorised user' a/ s9 w! j9 T& r; ^
Individual Data (Maximum 20 marks available)
, m6 l$ P# C5 y; J, \* G$ Y5. 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.
5 T' U8 a C9 {5 k; zDocumentation (Maximum 10 marks available)
; B' O, ~6 H1 j, c6 F3 y6. 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.! ?5 D1 {3 a) u; K6 w# _
BSA104 Business Programming – 2007: Assignment 26 I( g( n! f" D I: C- }% n% g+ h6 M
Page 3 of 5 |
|