|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: L) N& v7 I% \* b# B
Shanghai - 2007: J0 P" ^! Q7 @1 ?9 s1 h$ I# c
Assignment 2
4 ~ a* N8 ?" u" \9 GDeadline 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)
5 i- X% `6 i" y4 D1. 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.
+ j4 A2 l; e7 K& D+ B3 oThe staff must be able to:! x5 i1 }# l& t/ h8 \$ R$ i& O
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.; \, G W4 ~( b |# y3 W( l+ L& w' A
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.
6 u1 A* H9 I5 a The interface should provide a menu so that the staff can:
2 e- y* @( N& a2 J2 F0 c* da) Enter the names of the two Java program files to be compared! k7 p/ q+ f; Z3 s# ~
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 @" M9 J/ Z3 i X( u' L8 S** 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).
. b; |- r0 ?9 v$ \. bBSA104 Business Programming – 2007: Assignment 29 K$ Z) U6 i8 S3 \. a: x
Page 2 of 5$ t9 Z) m/ l( H) s
b) Print out to the screen all the lines of code that are the same
: k: u/ Y' G8 \7 b; q) k! C Include the name of the file and the line number of the code being printed for each of the two files
8 b- b$ C4 }7 Q7 V( Rc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared8 d W9 `* k& @- z8 ]3 ]2 I4 ~) D. z
 the name, username and department of the user; y6 e" m" e$ q, ^8 A; ` I: K
 the statistics of the comparison
1 F! S' B( c9 v3 O& G8 x! `& H- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
( x- H% ~( S1 M, x the recommendation for further checking
0 p6 ]/ K+ N: m- 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
& `+ R3 `' {% T9 p9 w the names of the two files compared8 e0 y, r0 I( B
d) Leave the program (exit)/ z2 Z! c6 T, g! t7 I( U/ k$ i: G& c
The ProgramCompare class: (Total maximum 20 marks available)$ V. |. h- j+ ?- A. a
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)6 P9 Z( d7 f. k1 [) x, G
a) provide an error message if the files are not found or there is a problem opening them
( z+ a$ K0 F$ a+ _" Kb) compare each line of code8 o: I" w- W Y# t) p* `
c) print out the lines that are the same
& ^7 `6 B0 @7 ~5 nd) count the number of lines compared / lines the same( Y. g" w( _5 ]% C( c& p
The AuthorisedUsers class: (Total maximum 20 marks available)
% t! e& B0 I# G# m% D7 j3. 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)
9 A/ l" `2 {9 E* P/ u$ o% L4. Provide methods to:
7 E, W+ `; @* v8 T6 Y+ o8 Y0 D2 xa) 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
8 q$ b( x5 N$ A- u6 H8 S* ^* Mb) return the name of the authorised user
* A ^( @- o' l& a- U8 j& Lc) return the name of the department of the authorised user
+ z4 K0 U9 Q1 oIndividual Data (Maximum 20 marks available). e% C' c2 \# Q3 H0 i
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, v+ c9 T2 k6 Z4 Q. @6 j
Documentation (Maximum 10 marks available)
7 ]6 {6 e" Z3 W8 E" {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.
/ ]6 m, b8 }' A% aBSA104 Business Programming – 2007: Assignment 2/ l5 U6 Q6 b% }$ f2 u
Page 3 of 5 |
|