|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming, n' O. G' e6 x, z9 ]: b; y" B
Shanghai - 2007
# g4 f; j; I5 a2 ]% h: i) \Assignment 29 z# s& y5 n& _1 ~: y8 d
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)
! c! O/ P0 @7 X$ h$ n# L5 V5 @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.
, T6 R' j' [/ {% S) h) l6 iThe staff must be able to:5 F- R0 x8 u- a* |2 X
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.8 Y+ ^9 ~6 z' | O. u/ Q
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.
, u: W- ~" ~8 k. l$ N$ l! l The interface should provide a menu so that the staff can:! d- M: o2 Y; n6 J3 | G; ]1 _) @
a) Enter the names of the two Java program files to be compared" Y; k; N1 Z j$ D# S' h
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.8 F" N! U4 C$ x8 }/ i
** 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).
* }" o3 Z2 S O6 @, \BSA104 Business Programming – 2007: Assignment 2
) g7 n/ x% X- L! F: nPage 2 of 51 L+ R: [& u1 o% C! \
b) Print out to the screen all the lines of code that are the same
. P4 o: a, `0 j Include the name of the file and the line number of the code being printed for each of the two files, h% |8 G; Q- _- L1 S$ B3 {
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
5 @+ ~+ c( t: @, U0 D* {# u the name, username and department of the user
6 M* K$ E- a% Q4 ~ the statistics of the comparison* _' }) j- f! t5 g7 F) x
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different0 M! Z) f8 f+ `! {3 B
 the recommendation for further checking7 K8 }' i$ F k& Y
- 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 closely7 V) m. `0 a& ^5 S. j
 the names of the two files compared2 j. l$ F4 I/ \2 y3 K ]2 Q
d) Leave the program (exit)
% {8 F* ]' @3 e8 k- J1 {, g) KThe ProgramCompare class: (Total maximum 20 marks available)1 j! f- D+ o# ~8 v, `6 J
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)
& S5 N8 k- P# Z/ Z( D# `a) provide an error message if the files are not found or there is a problem opening them2 C7 }6 Y% A1 n. C$ ]
b) compare each line of code
0 ^' @2 z; @7 M9 j/ U: |7 ~c) print out the lines that are the same4 E7 y- D; i8 |) i- m
d) count the number of lines compared / lines the same
$ o: H" {. x& d EThe AuthorisedUsers class: (Total maximum 20 marks available)
. X# P7 w9 z4 r( w3. 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 N& S% f/ g4 B1 ]: U, p8 v- q
4. Provide methods to:
' m0 Q0 t. o+ Za) 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
" l- z, O% T( w1 V7 Q! B: nb) return the name of the authorised user
. `2 c- [( o8 `# @0 Qc) return the name of the department of the authorised user
9 e2 J X; L) E8 `9 _Individual Data (Maximum 20 marks available)* g- V6 }) a" I7 A' o& y
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.
2 Z2 O4 K6 M+ Y3 P( ]' lDocumentation (Maximum 10 marks available)
4 b2 E* T7 s z5 L' a! ?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.
% l# y! t) v- ?: W% v! q% p# f% CBSA104 Business Programming – 2007: Assignment 2
2 c4 E9 l# h( y6 H- pPage 3 of 5 |
|