|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
. [4 k3 T* y3 N4 e$ k( ^( }Shanghai - 2007
/ S1 R9 c* Z( w# K* y( D* MAssignment 2; c2 ~$ g. \# ^5 `. F1 [; z
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)
3 m& M+ ?9 @! ?* n8 @0 r) F1. 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.
: N' _) T6 T1 bThe staff must be able to:2 T: d, E) o9 Y' M
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.3 R% u6 G: L1 U! d% V, d
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.
. }( ~3 [$ ]2 R# x) t0 y The interface should provide a menu so that the staff can:
$ X! X0 m4 j; G" ~0 P: N* s9 Q% Ua) Enter the names of the two Java program files to be compared
8 U- f$ _$ W0 J: a9 p; { For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
6 w% w& z- H, \, V** 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).
3 o0 _3 j/ E( r5 E2 h7 j1 ~BSA104 Business Programming – 2007: Assignment 2
+ m8 @( w3 w$ ^0 {5 i$ q5 |. m+ }6 RPage 2 of 5
, U( V: o( p- B! y0 m6 W' tb) Print out to the screen all the lines of code that are the same
8 U& g4 g1 u2 O# ?% b! ~ Include the name of the file and the line number of the code being printed for each of the two files4 W- A1 J3 s: r) A; j' {; M- n
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared2 g" {# Z" P3 f9 d9 z4 B: a
 the name, username and department of the user
) x& X$ t% ^) Z& [9 O. g9 C+ c5 v the statistics of the comparison4 O3 Z# E( X ?0 [, W( J' @
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: ?( ~( g+ R% e8 f4 y, M" D
 the recommendation for further checking
* Z# E: ~ b1 k+ `6 W: r- 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
) v' h8 F( s+ ?6 X4 B the names of the two files compared: m7 r/ ]/ n6 e2 q+ X5 ^
d) Leave the program (exit)
+ L1 C3 Q1 T- e% H5 tThe ProgramCompare class: (Total maximum 20 marks available)
1 F4 A5 e: U9 `4 o; E- j- x- p2. 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)
7 n6 y! v' g5 V9 `) s/ Wa) provide an error message if the files are not found or there is a problem opening them/ A* e% ^) A; }: ~$ A8 x, y
b) compare each line of code
) S% Y1 |9 R, I, T9 nc) print out the lines that are the same
! k Q2 |& a- j( l" i4 Wd) count the number of lines compared / lines the same
{# f% X$ W& Z, CThe AuthorisedUsers class: (Total maximum 20 marks available)
`% b& P {0 S7 w3. 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)
* u3 H, b: m o: _" z2 p4. Provide methods to:
6 b) X6 \8 B: u# ~+ fa) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match2 X2 [4 B; i8 l% n0 j3 q: W
b) return the name of the authorised user4 i, D3 y; W' s
c) return the name of the department of the authorised user
: B! g1 X9 U, y$ @; {; AIndividual Data (Maximum 20 marks available)& ?; r- |: o( D0 ^1 O) j8 D4 ^* H
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.
a- J. j$ ]" G* y8 \Documentation (Maximum 10 marks available)
% u; D) {0 y/ G2 d6 A6. 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.
( k& y5 _+ {, b* oBSA104 Business Programming – 2007: Assignment 28 \, T3 J, ?9 l) @* ^+ Z# _3 b
Page 3 of 5 |
|