|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: B1 H, i9 u; J9 f
Shanghai - 2007
2 m9 A# ?9 i4 d9 o) x8 ~% R- DAssignment 2) v1 q9 ^0 r$ g3 I% K
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). ~& d* K# a7 K) c* q2 R
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.
4 \; p' T) Y( O# nThe staff must be able to:
) t* {* S3 K8 O0 H( m Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.3 L( L y* m _
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. P' m2 f7 ]4 m* h
 The interface should provide a menu so that the staff can:
+ q: P6 j8 q, }3 S! N7 Da) Enter the names of the two Java program files to be compared! I6 p4 W! Z5 H& ~6 |- A
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
! I ^5 m% C3 p( Y+ ^1 [3 J** 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).
( y. }4 S" D; Y: _$ JBSA104 Business Programming – 2007: Assignment 2" e V2 h8 ~) T. d' b+ [
Page 2 of 5( ^9 w$ o7 A. H
b) Print out to the screen all the lines of code that are the same0 I- H9 t& M' o: K
 Include the name of the file and the line number of the code being printed for each of the two files
h a$ C- c* Q. a4 @- \5 xc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared: ~1 X: }3 s. L2 l9 {8 _
 the name, username and department of the user% J% C5 s7 {8 d4 S* y
 the statistics of the comparison5 s" O, Q6 G) l9 I
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ P q! M! c6 |6 c the recommendation for further checking) i% T4 \; g; R+ j
- 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
: A4 t# W, E9 L+ a3 X3 Q the names of the two files compared; s8 u/ J5 W& u
d) Leave the program (exit)2 Q7 M6 R" d' h+ o8 R( b, Z2 T
The ProgramCompare class: (Total maximum 20 marks available)6 m; t1 T# S4 v$ F& H
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)0 s4 M; V* O O F$ @% ]- H- k
a) provide an error message if the files are not found or there is a problem opening them8 j# V! O( Q1 b) v$ M
b) compare each line of code$ X+ C1 v) Q. h; s
c) print out the lines that are the same% k, P, g4 k8 D7 d# _
d) count the number of lines compared / lines the same
, a0 n2 g% A" v# Z. W$ a+ NThe AuthorisedUsers class: (Total maximum 20 marks available)8 ]$ t1 ^ A: U
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)2 k" e0 E7 W3 D# f( p E- ]
4. Provide methods to:
/ q% A- o# P* Q. {1 V4 }; q* f) qa) 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+ P D3 b( A6 l( u9 n! o
b) return the name of the authorised user3 O K1 ~ T4 G/ [. i. U
c) return the name of the department of the authorised user, n9 P2 V3 L* K+ s( D, N0 s
Individual Data (Maximum 20 marks available)
, f6 i" u0 d$ | r5. 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 z4 P* N4 Q% r! n# ?# a/ z9 MDocumentation (Maximum 10 marks available)
, p( y* B. [1 ?' K2 c, B& p0 j$ R6. 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., }& v! p2 P0 M
BSA104 Business Programming – 2007: Assignment 21 \% P* z/ q: ^+ A9 c- ^( Q1 v
Page 3 of 5 |
|