|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming- L; t6 `, G/ P
Shanghai - 2007
6 b _" r5 |, a1 D3 `7 cAssignment 2: e2 `. C3 b+ K6 i2 Y4 v. `% i8 R
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 ^& a; B0 X1. 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+ w5 y) }, [( k* r/ ^# z9 z7 l2 U. o
The staff must be able to:
4 H. L( G: T) ?, H) L: z Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.6 c" s. u% h) V7 E
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." r+ U/ ?$ K- \2 v! h4 b g/ c8 s3 ~2 `
 The interface should provide a menu so that the staff can:
, {. l" f: k. A* g/ n0 Ta) Enter the names of the two Java program files to be compared
' M5 o# i/ }: l7 S; Y For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 ` \' _- ?3 G; u2 c0 n3 F** 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).4 l# X9 k6 H& D# G4 {9 @! `
BSA104 Business Programming – 2007: Assignment 2
" U% F4 g8 s) {, }$ U$ [ aPage 2 of 5) t) V' Q& m4 ~" n! e7 N# I
b) Print out to the screen all the lines of code that are the same
6 \* L e' W( E* c3 J# i- g Include the name of the file and the line number of the code being printed for each of the two files6 e. L$ E- J2 w/ x* M; ~
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
* D& Q& _& s) ] the name, username and department of the user: ]/ S$ R# x' i
 the statistics of the comparison/ t' b* t+ {, g4 r$ o
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' O8 e. d3 {- z, s% N the recommendation for further checking
# h. A' ?% f- K- t+ f2 h& w- 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
) {! E! q4 S4 _2 g the names of the two files compared
5 {; G8 ^5 p0 N- C' L# J# Od) Leave the program (exit)
5 P6 W$ E4 o, n6 f( k- C$ P3 tThe ProgramCompare class: (Total maximum 20 marks available)
( z2 P( B1 F) g7 J9 @& b: e2. 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)( A. M1 k; \6 D5 K
a) provide an error message if the files are not found or there is a problem opening them
7 m' s1 y3 b! I4 s3 i$ h' T |) I/ gb) compare each line of code
. g# ~# b# D' Gc) print out the lines that are the same+ B b' H% ?& s$ z/ |) e
d) count the number of lines compared / lines the same
, y% H- k" u7 @, W0 `The AuthorisedUsers class: (Total maximum 20 marks available)
4 ], m8 l2 T) f. n- j; W9 _0 `" ~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)5 v8 y$ m4 o- ?. J
4. Provide methods to:
$ o0 P* k/ M4 ?4 S8 ]0 Oa) 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
{0 f4 y1 y1 i( Y8 G3 ab) return the name of the authorised user
; n' f' O9 J& M& r. Y H+ N3 cc) return the name of the department of the authorised user2 m* G j& G+ O9 } }2 c- r: \0 z
Individual Data (Maximum 20 marks available)$ [" J" M+ w/ e F( b8 ?
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.2 z! s2 N; ^7 ~$ ~6 A( u
Documentation (Maximum 10 marks available)
! T" a# x* z) B# H6. 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.
8 v5 A7 v3 }2 B% z- rBSA104 Business Programming – 2007: Assignment 2
8 ]5 q" ^1 F. [& w) _1 C4 | h+ rPage 3 of 5 |
|