|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming3 _: v* z; Q# Y3 t7 F& T5 h" S
Shanghai - 20076 C; J/ P2 C! d+ q9 H
Assignment 2- ^. m, B1 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)
* [, V8 |8 ?! p1 k( ?" O1. 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.
. K6 k% b' d. G- u1 sThe staff must be able to:
$ C% U: W$ W7 [) e4 n! v* e Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
8 c9 o+ |2 M6 ]2 m, _7 o o' t1. 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.7 k2 @5 b4 x% B$ {% u- u8 y8 B
 The interface should provide a menu so that the staff can:
0 F \! W* N: M/ S) c. Wa) Enter the names of the two Java program files to be compared
- C: m# S, \+ G- k$ a& L% ? For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
# V) Q# Z9 T9 @# {6 X3 [6 ~4 r** 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).& D3 M8 l9 f. {* f; z
BSA104 Business Programming – 2007: Assignment 2
: c( o# b' J' G1 e6 uPage 2 of 5
3 V9 E, H" ~, K8 v$ {5 mb) Print out to the screen all the lines of code that are the same2 b- ?/ \* h! z! n5 }
 Include the name of the file and the line number of the code being printed for each of the two files
+ f, R; h! }3 s# i7 Z; Oc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared; w& g! A5 \1 J% Q# x0 D1 s1 [3 c1 X
 the name, username and department of the user
) T/ c3 r$ `" G4 x8 x/ e the statistics of the comparison
6 i) B x* {5 L: L* t; F- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, g* Z. p1 C4 Z4 S the recommendation for further checking$ O- s2 C' ~2 Q7 S$ X, R- e9 o8 _
- 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# {2 D3 e6 [* s1 ?3 k( {
 the names of the two files compared
8 z* G& ~& `) y7 S, J1 I# {d) Leave the program (exit)
# ^6 r# s; b# U% ?5 A9 lThe ProgramCompare class: (Total maximum 20 marks available)
* ~- z- e* ~/ Q/ u2. 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)$ H* j8 K9 d) }
a) provide an error message if the files are not found or there is a problem opening them
( k. p1 Q6 |# M) I5 Q G9 a3 Z, ub) compare each line of code
8 S9 c( r# i: |, c& dc) print out the lines that are the same8 |' z; i D7 w. X! q4 k' m( o
d) count the number of lines compared / lines the same
8 D5 v3 |+ ~/ e" {3 yThe AuthorisedUsers class: (Total maximum 20 marks available) p- X7 l m2 l% j
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)4 P8 I) p- G' Z$ u0 s2 H
4. Provide methods to:4 O8 G3 N4 p# L- E, z
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
6 Q! E% d& c3 [9 V4 L, Fb) return the name of the authorised user
7 f( N; g5 v9 w. V+ Kc) return the name of the department of the authorised user- F1 g* }! q/ o% v
Individual Data (Maximum 20 marks available)
3 L& s0 F/ _- f- }' p5. 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.
_1 V u G6 y* V4 C" U2 c) UDocumentation (Maximum 10 marks available)# D K. E, A! F, {9 G( y% P1 R
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.
' X4 ?# y/ q7 x2 @* mBSA104 Business Programming – 2007: Assignment 2
5 I' }: j6 M0 x7 y, ]) mPage 3 of 5 |
|