|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ c) t6 z6 l" h+ X3 W
Shanghai - 2007
9 l: { t1 ]8 @Assignment 2
9 x, T1 `: @6 I- N+ _' a; aDeadline 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)
; w2 }+ V, W% q1. 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.
5 x3 \ n2 B3 Q% c2 V R: A" S, T* ^' ]- B8 zThe staff must be able to:
2 J& R) f$ ]) K h5 c" p# s/ N Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.. @( U' O: R+ H o+ ?% i
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.( O% F1 c1 T: Y+ a
 The interface should provide a menu so that the staff can:: y' k" v( B3 n9 V- Q8 Q H4 \
a) Enter the names of the two Java program files to be compared$ g9 \0 l0 h5 i
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.7 Y' a" v2 K9 ]6 H: [% o
** 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).
! f1 _9 P9 i3 y, l2 yBSA104 Business Programming – 2007: Assignment 29 E7 B5 k2 A& A) a
Page 2 of 54 r' E1 d: e) l. w/ {. E5 e. ]
b) Print out to the screen all the lines of code that are the same
0 ~2 {) [' g, z Include the name of the file and the line number of the code being printed for each of the two files
! c) ^$ p( U4 x! c; h" jc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared/ l, m+ x5 W8 Q2 f: x; B) e7 _
 the name, username and department of the user
8 T# s- D1 Q Z% c/ E) A; t the statistics of the comparison; }0 t \' r% F! L( ^. x( O
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' D9 t% e" w5 [ the recommendation for further checking
$ t+ p n& A# x+ I& H$ Q- 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 @/ r; Y2 G1 K5 e8 B- {) x! Y
 the names of the two files compared3 b- r; b9 k2 T* ?: K9 w
d) Leave the program (exit) S( E3 Z7 J9 G2 _) t- i4 f3 J
The ProgramCompare class: (Total maximum 20 marks available), Y' ^/ G- }4 Y0 Q
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)
. D- h9 f1 N3 d7 @a) provide an error message if the files are not found or there is a problem opening them
& U8 Q& i" Z" Eb) compare each line of code( o* Q0 L# q) T8 l/ `
c) print out the lines that are the same5 o3 `( ?+ h5 r, h7 r( T( o
d) count the number of lines compared / lines the same( |7 x) }! u+ [: V7 H0 ~7 n: l
The AuthorisedUsers class: (Total maximum 20 marks available)# Q" t% e' q/ `3 k8 u
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)9 z1 D) ?) i4 \! t. S
4. Provide methods to:
" l: a7 I5 |) O' Ka) 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 a9 A1 {0 Y0 nb) return the name of the authorised user
- c; p, x# n& e+ F! Vc) return the name of the department of the authorised user
2 e& K7 h6 V2 Q2 W2 h5 `Individual Data (Maximum 20 marks available)+ E; x; k+ R/ [8 H5 s7 x+ t3 q
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.
# Q1 n& K; l0 |5 b" i$ IDocumentation (Maximum 10 marks available)/ g6 D0 Y+ G8 l# p& N7 H+ G4 ^
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. J" y+ _8 {2 B) c j6 y L$ n
BSA104 Business Programming – 2007: Assignment 29 r+ D3 c W' n) a- z' j
Page 3 of 5 |
|