|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
, Z7 v/ L* C) W! D" G6 oShanghai - 20070 x ?, Y! G* e8 a6 w& `& P- }& a
Assignment 22 N, `9 ~( A* }" a( m: _' u8 D
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)
% ^. x4 y1 p2 c" g5 g6 D1. 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.5 A; `9 Y! E6 p# K7 `4 M* S
The staff must be able to:, A, V" X! u7 q* Q0 E$ s2 f z
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.$ i4 o- E/ L' h+ K1 H
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.
6 N. p) g. t& }, t The interface should provide a menu so that the staff can:3 x/ R" w3 W- C; a3 U5 H
a) Enter the names of the two Java program files to be compared
8 K e7 T) H1 f0 ~ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.1 a6 ^4 n0 D$ a& O) X, i! Y" {
** 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).9 z- p" `/ H, g, n, |" W/ H
BSA104 Business Programming – 2007: Assignment 2
: w- |$ O5 O/ j% L9 [# aPage 2 of 5
# |' N7 K) w$ @* V& @1 T0 Nb) Print out to the screen all the lines of code that are the same
+ u4 O& _# ]& r7 i Include the name of the file and the line number of the code being printed for each of the two files
; e' `: l( e, v7 q0 W( kc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 w+ C$ s9 I2 x& [4 a+ c& u) g the name, username and department of the user6 m) A. h8 G1 H; I( ~0 q% b
 the statistics of the comparison
/ u1 g- X: }1 }3 n- H9 v- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
. }# Q4 G2 ] Z/ k, g7 e% K the recommendation for further checking- S. _- k4 w% y: Z+ O6 F
- 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, b( }' S9 l# P/ f3 R
 the names of the two files compared& S* j) Z2 D1 D
d) Leave the program (exit)
! _4 ~/ E* j' @The ProgramCompare class: (Total maximum 20 marks available)' H, \1 O0 t* ]
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)
8 O8 k& j7 l* m( b- h* ]6 z2 La) provide an error message if the files are not found or there is a problem opening them
( Q8 K2 t2 L" M0 o4 e7 S6 fb) compare each line of code
3 M" H5 K1 W1 d' k$ {: o6 mc) print out the lines that are the same
, _3 t0 ~; O7 { o) _) f |. ?* [d) count the number of lines compared / lines the same
' @" N6 l4 O9 v+ bThe AuthorisedUsers class: (Total maximum 20 marks available)
* l6 O0 F' n0 m" M/ G& Y9 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)7 @3 _) Y e! }# k2 s' X1 @
4. Provide methods to:5 O& |6 b+ y$ W" a! C/ p
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
2 v) T+ K( V6 i% _+ l9 m5 f' rb) return the name of the authorised user
5 i2 Q3 V" s5 S; y. J+ l( ^: z0 ac) return the name of the department of the authorised user+ R Q7 I2 L) ?* i" y) D" d
Individual Data (Maximum 20 marks available)
5 W; }( ~: Z- R2 f9 P3 o/ J5. 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., M: q; W, U$ R7 K
Documentation (Maximum 10 marks available)6 s0 n3 W+ V* @! r" X% g% Q7 w
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.3 ]& l O! i$ M* r6 L0 e
BSA104 Business Programming – 2007: Assignment 2' O3 H2 n$ h! i, u0 g* o
Page 3 of 5 |
|