|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming* _. G4 ^) O2 @# _! R- X
Shanghai - 20079 b5 \+ k2 z3 `$ ]* u% F7 `
Assignment 2
+ L, h" K8 `' TDeadline 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)( W5 W" w( h- u: @5 _
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 E5 W ], c7 oThe staff must be able to:
5 C# }! S4 A& A4 J" L Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! p, p7 {' k- o/ 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.: d+ s$ _) n% b% W3 f' c/ f
 The interface should provide a menu so that the staff can:
0 e% o: {* T" y4 L, y6 M, a( Ca) Enter the names of the two Java program files to be compared; |4 T* c9 i8 G1 c% M. i+ C% |
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
6 p# ^2 K' c$ F# e7 I: h, 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).4 L- c& w# M" d0 P5 Y
BSA104 Business Programming – 2007: Assignment 2# P/ N, G7 R% W5 e. g
Page 2 of 5
6 X8 A) H& [- I* E3 |; u0 Y( j' Rb) Print out to the screen all the lines of code that are the same
6 ~/ i; @. \# x% ~3 M Include the name of the file and the line number of the code being printed for each of the two files, `0 B& I* K- K) d! w# r
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
2 i( r. P- m5 T1 P the name, username and department of the user8 c! P4 F, V% J* ~8 s
 the statistics of the comparison
! k3 e+ m% h( F$ I/ _: `- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: g6 T) [0 v" }0 o* c% w% O, h4 }
 the recommendation for further checking) M. t% ?( L) T" g! {9 m4 `& g
- 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
3 O1 r* I' z$ d5 }1 m5 L9 R the names of the two files compared
( g2 I+ [7 t: ]9 z/ I1 E8 nd) Leave the program (exit)
# y0 p6 }) u# MThe ProgramCompare class: (Total maximum 20 marks available)6 x, H) v' Q! [' f3 n" _. U$ y) O
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)/ \2 F& q4 P! f6 `, l/ m* d" }
a) provide an error message if the files are not found or there is a problem opening them
- B) h4 w& L Q8 C' {+ X& {b) compare each line of code" \" }/ q4 L/ |9 p( L
c) print out the lines that are the same0 X' j) h1 T' i! c
d) count the number of lines compared / lines the same
& `% O9 ]) ^. X" l! t: w+ Q) T% MThe AuthorisedUsers class: (Total maximum 20 marks available)
0 [7 L; ]# \6 _7 K$ l% Y# |2 a: p3. 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)6 s1 }; C) }8 x* u% W
4. Provide methods to:* _/ e" V1 V/ J7 k- g( R3 _
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 match0 S. S* _" c+ P6 R
b) return the name of the authorised user. x1 P! x0 \% ?* q; c
c) return the name of the department of the authorised user2 k7 U( A! i/ l) P
Individual Data (Maximum 20 marks available)
; u: z' f$ h( q9 N- t% t% ?# M0 n5. 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.
: O3 i+ B7 F( r+ q' q; yDocumentation (Maximum 10 marks available)
7 _; ~( |5 j3 |8 t6. 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.
] D( H* n" [6 ]# b# ~BSA104 Business Programming – 2007: Assignment 2) f7 @: E% x$ @1 q, B8 D
Page 3 of 5 |
|