|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ I) b; v) R- }; j8 y3 _7 Y' w
Shanghai - 2007! A: Z8 |) Y+ j1 \2 n1 K
Assignment 2
! x- ]8 {5 Y& e0 J- v' h; bDeadline 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' [; o0 Y9 F! Q2 O9 C
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." ]' t* H/ T* Q
The staff must be able to:
; M: E; P: d; q Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.0 p$ i5 d, y; `3 {; m _3 D- S+ j
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.
9 A; A+ c) G: m' V The interface should provide a menu so that the staff can:% \2 @+ z" j s8 e( ?$ u
a) Enter the names of the two Java program files to be compared
; C" ?! k4 B0 p7 A0 F For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
" f2 J( k0 b# ^" c** 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).* P& I% [7 G/ X2 V
BSA104 Business Programming – 2007: Assignment 2
+ ?. t5 c Z6 wPage 2 of 5
* [0 O0 X/ H; G$ W6 ]b) Print out to the screen all the lines of code that are the same
3 i" r8 g6 ?: l) c) B9 ]: a$ D Include the name of the file and the line number of the code being printed for each of the two files( c. e; F; f% ?9 f
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
# L! Y" e5 h, D1 m the name, username and department of the user$ D& x( j! V2 b. I; x
 the statistics of the comparison
) s1 l5 s+ k" u! n2 l0 `- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different4 f/ Z5 p. M# r9 W8 ]
 the recommendation for further checking/ h: ?: r; v. @) L. ]2 U# b
- 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 closely3 k( r6 E* k( ~) M- V7 e
 the names of the two files compared8 L& X1 R: o: k7 s
d) Leave the program (exit)1 J& O$ W1 `9 f; s$ N7 O( _" o! z
The ProgramCompare class: (Total maximum 20 marks available)
2 K& \, q% Y* {6 W- n; y2. 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 K& z" @8 z ja) provide an error message if the files are not found or there is a problem opening them
" {$ x4 k: S/ M7 ?& {& D0 {b) compare each line of code2 w# O* S8 f; m X. K
c) print out the lines that are the same
5 ?! e* ~8 r- S( f7 v8 Pd) count the number of lines compared / lines the same& s0 U3 x/ Z. u! Z# w# R4 d
The AuthorisedUsers class: (Total maximum 20 marks available)
* l) \4 K9 O; |7 t+ c1 t3 @ X2 |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)! ^4 d; f! |8 B% \% u1 r( _
4. Provide methods to:8 S! |3 a( I; F
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
/ K- \ F' I% j( ~0 ^& c( s2 A# mb) return the name of the authorised user
7 b; `8 Z3 a' x1 U. z% H) G- `% Nc) return the name of the department of the authorised user. \# ^1 X" H+ k
Individual Data (Maximum 20 marks available)
! U; G% @, n$ i+ u9 S5. 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.; s+ j* o$ @, @
Documentation (Maximum 10 marks available)
w' Y/ w- w4 W. d6. 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.
5 B3 G) s* d0 h8 BBSA104 Business Programming – 2007: Assignment 2
* M' ]$ J5 J e0 S" VPage 3 of 5 |
|