|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming! ]& z. u) H. V* |; a2 J/ N
Shanghai - 2007
# @4 Z$ p" k9 {3 M3 S) z. B3 C; OAssignment 2
2 R. U% g$ J5 N7 {6 r. aDeadline 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)
9 m$ X6 {! A1 C3 a# G$ }) K" l; K* p+ Z1. 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.
0 V) n. E& c) l \. HThe staff must be able to:+ g: ^0 Y4 A d1 X% | ^' J
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.8 Q# J$ \% Y m# q) @- Y
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.
- w% w. j; v) }4 ] The interface should provide a menu so that the staff can:
9 h$ d8 n7 w2 [1 E" p) X8 Z+ b: _& xa) Enter the names of the two Java program files to be compared. f: ?( S7 P4 D( j! t
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.* G+ v3 Y. o T6 W$ o
** 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).& r; V- ]% J* ?$ s" `- w f3 ~2 H
BSA104 Business Programming – 2007: Assignment 2
+ M' x% c: l5 \8 J6 T2 K" k4 ~Page 2 of 5
9 Y* \1 \8 k3 l1 P$ Vb) Print out to the screen all the lines of code that are the same5 ~' Z" P0 J2 P
 Include the name of the file and the line number of the code being printed for each of the two files
: o$ }% x/ e4 D5 K3 D* [" H+ lc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
7 c1 V/ d, Y2 F7 R& R the name, username and department of the user
0 f5 M) f/ E* p7 s. j$ g. g the statistics of the comparison
T7 B0 |4 c$ _. ^2 F- {/ K/ p- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
1 t. H) ]: j! h3 [5 X* s p the recommendation for further checking
, K4 N$ {! v% `! ?+ i2 F" K, [- 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; [' C! n# S2 Q$ F. ] the names of the two files compared
& g3 S: J# \8 Ud) Leave the program (exit)
, ^+ }! n& W2 _The ProgramCompare class: (Total maximum 20 marks available)
% N4 F; w+ `9 T. d* T2. 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)
7 R4 k/ ]* Z* \, J6 Z1 M1 qa) provide an error message if the files are not found or there is a problem opening them& b' n. X% t; Q, B) o
b) compare each line of code2 U# ^: G7 Z9 {, m% R; \( j
c) print out the lines that are the same1 \" N1 {' g; o/ M1 ^
d) count the number of lines compared / lines the same
" ^, \5 m3 a4 C1 l2 F: \The AuthorisedUsers class: (Total maximum 20 marks available)
6 h7 o! p- H0 t3. 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 [1 t2 a, g* R& i. K
4. Provide methods to:( n! m+ h$ n9 O8 D3 t% P+ g6 i3 F3 S
a) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match5 b: {- _" @- Y. z
b) return the name of the authorised user
+ _1 I' [1 V; p! \9 e* Rc) return the name of the department of the authorised user% z( ~/ z T0 {, r# Z5 I/ c x* S
Individual Data (Maximum 20 marks available)( j8 V6 r7 ?. h! E
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.# L1 w, d" @9 }; r5 l0 E7 w0 j
Documentation (Maximum 10 marks available)
) g7 X3 X4 E4 I* o6. 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.. _& I$ n6 |& ~4 o
BSA104 Business Programming – 2007: Assignment 25 v6 F+ Q% W# b( t I
Page 3 of 5 |
|