|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming6 P7 J0 a8 H1 ?4 |
Shanghai - 2007
: t+ S0 P0 U: j- d: `1 b) \Assignment 2) S6 j4 p( h/ e
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)
" `9 }8 O/ i" ]+ r% k, c1 R# g" E1. 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 s1 Z; X1 G% n' R& d# TThe staff must be able to:
% l2 a6 k: Z s6 T Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
0 r0 _! X2 r/ h5 K6 P& N1. 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./ p" Y* K$ h0 x* f4 ?
 The interface should provide a menu so that the staff can:2 v/ C+ E+ G* M$ p3 ?& @9 I- M
a) Enter the names of the two Java program files to be compared
0 B# m- F- P/ N1 v I5 q# b For this assignment, it will be assumed that the two Java program files are in the same folder as your program.) {$ ]# [4 o/ |; ]* g
** 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).. A# C( V" j' m" G; C1 O# A( J" x
BSA104 Business Programming – 2007: Assignment 2; ^9 {5 O# _9 y' ?8 b9 {8 L
Page 2 of 5
1 a$ G5 w0 V" m8 X7 _# ]b) Print out to the screen all the lines of code that are the same/ e2 r$ {* L/ v% I, p5 l
 Include the name of the file and the line number of the code being printed for each of the two files% j( F& }( Y( H' x3 Z
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared# r7 ~8 X9 R! M
 the name, username and department of the user, j4 f f1 k; j9 x* r3 Q
 the statistics of the comparison
8 d, k) l2 ?/ {- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 R2 b p# V7 b) {# s* g the recommendation for further checking
. g) _2 V4 W7 y6 o s. P- 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: i! l3 }0 K9 y9 V
 the names of the two files compared9 u/ a0 G0 ?# q6 [1 m6 n4 h% G2 K
d) Leave the program (exit)5 e! d [! K/ \3 h9 f7 O4 u; D
The ProgramCompare class: (Total maximum 20 marks available)
1 e; c5 v+ ?. A9 ?$ J, ~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)$ U7 |8 I5 E; q7 j3 f
a) provide an error message if the files are not found or there is a problem opening them) {, ^$ M6 G4 F9 E @! L* y- Q
b) compare each line of code8 W9 H2 m3 f8 N
c) print out the lines that are the same
( V# R6 k) a, Y) c |2 V! [1 \$ ^d) count the number of lines compared / lines the same
5 |, \$ ~3 I5 A2 s6 p: ]The AuthorisedUsers class: (Total maximum 20 marks available); O* J; U% L( V H
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)3 t. b8 i- E8 G: D. {; [7 [3 t
4. Provide methods to: {. Y0 B. _+ Z& d5 I: n. H% u e7 h7 K
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 match- v1 A7 Y) r. F% U" {* _5 }: M" }
b) return the name of the authorised user) R# M8 G9 B% O% N3 O3 J
c) return the name of the department of the authorised user9 ]* z' S7 h& t+ l8 n1 q
Individual Data (Maximum 20 marks available)6 v/ Y }( a. h; s
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.
3 o. G4 L2 w9 ODocumentation (Maximum 10 marks available)
7 {3 Z0 N, W( ]. }# d+ T7 ?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 ?& {2 E8 B9 Z5 f6 OBSA104 Business Programming – 2007: Assignment 2
) n3 h0 G( x8 zPage 3 of 5 |
|