|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: ]- j8 i% K9 j: q1 s w" x
Shanghai - 2007' `% E% a, B* j% j
Assignment 2
. M$ N3 s( R/ U1 M9 RDeadline 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)6 y* K5 q" i" v& e
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.
0 a+ e# C3 x; b% z4 {1 rThe staff must be able to:8 U0 U% A7 x/ F% ] m* W5 ]
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! {/ A/ B% n4 `8 k9 v8 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.) \, I9 L/ y1 E7 L& V
 The interface should provide a menu so that the staff can:
6 |% b7 J K7 n* d; L$ za) Enter the names of the two Java program files to be compared: s6 r+ Q1 p G0 G7 a" P* q1 {* u0 M
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 K; \) O* l8 r; S$ v; K3 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).
. E0 D8 P0 z4 GBSA104 Business Programming – 2007: Assignment 2% u/ c/ a( @/ o w: M/ R8 J
Page 2 of 5
1 Y! T% N" i. m# @0 Kb) Print out to the screen all the lines of code that are the same; E/ ] d' ?, t3 W& ` X* L
 Include the name of the file and the line number of the code being printed for each of the two files
9 s. T5 |$ d, sc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared# M# T6 M' K4 E! u- E; B, P5 P/ ]
 the name, username and department of the user
. f+ x3 _! w# h! W& ~& m2 ] the statistics of the comparison( s# f3 m6 b& X8 V; h5 C" \8 L2 q
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
# P# N" i1 e3 ?2 R the recommendation for further checking8 J) Q Z4 ]' s$ P2 G
- 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/ _# \# c) J2 {7 u" T the names of the two files compared
; t! N/ \7 a3 I8 T8 ~d) Leave the program (exit)$ u5 n9 g3 j5 [/ Y# p" X
The ProgramCompare class: (Total maximum 20 marks available): d. D' u1 \! { B2 n
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)# g1 S2 Q S% `4 y. y4 g+ V
a) provide an error message if the files are not found or there is a problem opening them" g& e- G7 C" N" P2 x- `! D9 }
b) compare each line of code' r. P. Z9 H) s
c) print out the lines that are the same
# Y) h" k- S' H; X. od) count the number of lines compared / lines the same
7 Q4 o* w Z, @. L/ n5 U6 g7 }6 [The AuthorisedUsers class: (Total maximum 20 marks available)# \7 S3 p, o6 M7 d
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)( [7 l- V$ v2 K6 i# m: `
4. Provide methods to:
! S* V1 ^: c5 [6 `. y; la) 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; H/ ^4 l+ T- ?7 k* K1 P
b) return the name of the authorised user
) K$ z" I2 v' Z" o1 d S$ Y4 ic) return the name of the department of the authorised user
8 c1 s0 z. [$ gIndividual Data (Maximum 20 marks available)' E% O0 Q! T7 f% S: ]- j
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.0 V7 a- n2 u( q/ {) h8 F
Documentation (Maximum 10 marks available)* S4 Q/ P# G# ]; }/ U
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.
+ b5 T9 E, j6 M4 [1 P2 d1 e% OBSA104 Business Programming – 2007: Assignment 2* W2 p( V3 X: @/ H& _- [4 e
Page 3 of 5 |
|