|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# {% s7 j ~1 T4 [2 eShanghai - 2007! V% { W. m; V
Assignment 24 m2 N3 g2 C9 e4 e& X4 ^, a; Y
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)
. ^5 ~! ]7 k. D$ O4 w9 j1. 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.
0 y* {/ k& W% y* OThe staff must be able to:0 Q. W! ~! L+ j8 k
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.( P N! x: ?/ g k8 [
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.
' l6 w- |& U$ i6 K The interface should provide a menu so that the staff can:
* _) W2 S7 e/ [7 `a) Enter the names of the two Java program files to be compared8 t$ b7 |, J8 ?3 m3 D0 G
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
s1 K7 c& e- D4 K$ x6 L** 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/ b, a9 E- r2 z5 {4 k$ [
BSA104 Business Programming – 2007: Assignment 20 D4 Q* o6 c% Q1 N
Page 2 of 5& w: Q; B& j( W, `5 D" c1 J
b) Print out to the screen all the lines of code that are the same
/ r. s: ]8 F/ o q- b( E Include the name of the file and the line number of the code being printed for each of the two files8 Q# f5 C' ?6 q- L& x3 b% ]- g
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
- K1 q3 o f6 B* a9 X the name, username and department of the user
9 U0 v' d6 {% G% c1 \; `! N- j* i the statistics of the comparison" Q; ~% j! s8 E6 W
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different, r9 j& `' \: k% ? `2 l, v7 N0 {4 Y
 the recommendation for further checking& T* n; t/ x7 t# i+ l
- 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! e6 |3 I s" U' m' f0 g
 the names of the two files compared
9 l! z1 g; F8 {d) Leave the program (exit)0 o. F/ j8 [6 E; J- W' X, X
The ProgramCompare class: (Total maximum 20 marks available)
" U/ Q" `+ s5 x0 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)
6 Y) d5 O0 ~5 e3 X' ]; Q: [4 @a) provide an error message if the files are not found or there is a problem opening them7 c) m7 x8 r5 }- j
b) compare each line of code- |5 m% c' X% {1 u6 d8 p
c) print out the lines that are the same- Y4 k( j- H3 v3 m' r& {7 I2 T
d) count the number of lines compared / lines the same
3 h9 B! w/ k5 v1 \; U" hThe AuthorisedUsers class: (Total maximum 20 marks available), I0 x! J: O$ j1 _- H5 x1 J9 e
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 S9 c1 ]" b, S! `! U5 Z4. Provide methods to:
$ A8 \+ t# Z) D. y3 P( ra) 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: O0 a& C# y/ a, V9 r
b) return the name of the authorised user( [! x, v5 i% c6 \- N4 T w
c) return the name of the department of the authorised user
' d# W. A; w( HIndividual Data (Maximum 20 marks available)+ c# H7 x7 ^, K ~
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.; i9 d! U& }/ H$ l
Documentation (Maximum 10 marks available), Q% N0 W& \$ g5 n
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.
* V# c1 R2 V- S( c2 U6 uBSA104 Business Programming – 2007: Assignment 2; c% X* u. P# G: f) Q
Page 3 of 5 |
|