|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: G+ e" ^6 v: p# `% S1 n& P
Shanghai - 2007" p5 g, n' e& ]: W6 @: ~( S- f
Assignment 2+ e- L# L* O/ Z1 o7 ?
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)/ H" ? }8 F( _' T7 m0 J2 H; S
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.
1 w1 D- D$ l# gThe staff must be able to:) `9 u& Z( v g2 r
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.) p) S4 D/ z- z) R! L) 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.: y" i3 q! ]+ j! u4 @8 C
 The interface should provide a menu so that the staff can:2 D5 v6 T$ C) ~! i' z
a) Enter the names of the two Java program files to be compared2 l0 O( W# ^' @( {, P0 u
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 c1 [6 r# L3 T5 g t4 O4 D2 Y** 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).
$ o: ~5 ?( r R9 }8 y3 I8 UBSA104 Business Programming – 2007: Assignment 2
8 p2 ^9 ~2 P) L9 s0 fPage 2 of 5! t3 j! O4 P4 Q; l% ]% {
b) Print out to the screen all the lines of code that are the same
7 R1 \/ g' r d Include the name of the file and the line number of the code being printed for each of the two files7 p0 j3 r* R) Z( T2 n3 r; J
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
7 x3 r$ u9 }& t$ C. K. |( ^ the name, username and department of the user
( e6 B2 L3 D B6 L the statistics of the comparison
8 A' k4 |4 x& G- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 ]' q: v/ e7 b
 the recommendation for further checking
7 E* p1 M6 b. N- v, |) l/ t- 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
+ z1 k2 e4 W* `2 {2 W1 | the names of the two files compared
& v4 ^5 _& ]; N. Y: s- H3 S2 I: w0 pd) Leave the program (exit)
5 s& A* x5 p* sThe ProgramCompare class: (Total maximum 20 marks available)4 T6 k1 ^1 T" s: |+ O) P0 N6 E3 g
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)
# j; L' h4 G4 p0 s7 r% i" Y* qa) provide an error message if the files are not found or there is a problem opening them! h; S3 W1 [5 f# c
b) compare each line of code
' g( |0 F: `- U5 b8 b- \; sc) print out the lines that are the same/ {2 l4 H1 L- V+ `8 b% s, N
d) count the number of lines compared / lines the same
$ i2 `( d0 c0 E- \' XThe AuthorisedUsers class: (Total maximum 20 marks available)3 }2 e) t# `" s+ s
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)0 b/ S0 O9 l. a* }! h9 i
4. Provide methods to:% M- E+ F# b. z5 p8 T+ i' v0 E" } D
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
/ q/ w& d* y% R$ O: Q0 Jb) return the name of the authorised user3 e3 G# u# k) `+ c O
c) return the name of the department of the authorised user( Q) e9 S* |/ E# @4 J2 m9 Y& z+ M$ |
Individual Data (Maximum 20 marks available)) f6 G. t5 X7 O- Q8 y; E7 z# n
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.$ M" W7 b$ n: f9 w. X) B" m1 m# r
Documentation (Maximum 10 marks available)8 B/ G# L5 V2 F9 v4 n& z
6. 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.$ }$ }# {1 T+ T1 O4 {
BSA104 Business Programming – 2007: Assignment 2
1 H. ?( t' l C, y7 j8 G- V4 [Page 3 of 5 |
|