|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming6 w5 c2 o Z: K2 z" Z3 I
Shanghai - 2007% h) r" P& K' j# S
Assignment 2
+ s) v2 v3 S. O# E4 g+ `$ a* D% kDeadline 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). f- e- }2 M1 p! u7 o' q
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.- q, ]& N5 e& B, f2 t
The staff must be able to:0 H* G6 s, \6 k8 l- N
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
6 \+ O+ f2 I: z6 c S1. 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.4 F5 E# J3 ~+ p5 o* \9 t8 f
 The interface should provide a menu so that the staff can:/ p2 s% n9 G: `- I- @) Y
a) Enter the names of the two Java program files to be compared
, i. O5 G8 c e3 S& y For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
% m+ n" l; X- c: C8 s P** 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).
: i: t% x, L/ IBSA104 Business Programming – 2007: Assignment 2
( ?+ C$ [* P! @: s+ v7 p# H# ?Page 2 of 5
" | l2 d) u: d% ]b) Print out to the screen all the lines of code that are the same
$ w/ s! g6 E! x Include the name of the file and the line number of the code being printed for each of the two files# s4 K E# Y5 B% p
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared; o1 a0 I# j& V) N# D
 the name, username and department of the user
) }1 {5 Z7 x1 W$ t$ k the statistics of the comparison4 X9 n J, @3 x2 ^$ F
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
8 f' ^; M& s: {1 i# p, q the recommendation for further checking
* y% v) p0 ?# r1 Q- 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 closely2 ]7 S2 g! E0 z r
 the names of the two files compared- L1 d! s# r9 I8 [
d) Leave the program (exit)
) K5 i+ H5 D' T8 Z; Q+ o3 f$ @ {( ^The ProgramCompare class: (Total maximum 20 marks available)& ~9 E7 O" M5 Y9 u5 V
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), X( R3 Z! d* o( k9 `' @0 _$ v$ Y
a) provide an error message if the files are not found or there is a problem opening them
2 {& j! G, h& V5 m" z* Xb) compare each line of code
' L; M* g- T3 | r; P2 u; lc) print out the lines that are the same
" G0 [# W4 m" R% ^* C, |d) count the number of lines compared / lines the same' g. f4 ^4 ^$ R4 U. [. R
The AuthorisedUsers class: (Total maximum 20 marks available)$ a" h' _7 B& P* {, F, y
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), f# l0 o/ |$ O' \" o2 d
4. Provide methods to:& H& l9 e" _6 b; Q6 k6 g" s8 K1 V
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! Y5 N0 E/ i) K$ C* ~
b) return the name of the authorised user- c. o5 q3 O8 ~
c) return the name of the department of the authorised user
. l. p$ f7 T& ~4 a" ^Individual Data (Maximum 20 marks available)" G ^( f; @* @! U2 J7 ^+ c) z: U' ^
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.
) Y8 f( C& ]( yDocumentation (Maximum 10 marks available)
# @5 N8 M4 L2 w# V6. 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." x) K! n, X/ ]2 X8 v* ]
BSA104 Business Programming – 2007: Assignment 2
" g5 T$ u9 `4 p- Z7 PPage 3 of 5 |
|