|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 I; ?5 l; Z$ y1 O; xShanghai - 2007
6 N$ g: |2 V; i) u" d! u t/ \Assignment 2
0 V. i, \+ i1 I0 ]8 b- vDeadline 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)2 z7 o1 P0 G6 N% y
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.6 n; t' q% ^. q
The staff must be able to:5 Q5 i( A: c3 I M5 B
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
$ o: j j2 r- k$ T. D( S1. 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.: U1 k" R. Y1 ~3 y& e- U
 The interface should provide a menu so that the staff can:" l) _ O f! q6 [9 X
a) Enter the names of the two Java program files to be compared# ?4 L% z1 \. o7 Z
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.- b; L1 \3 ~1 D, u1 A x
** 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).
$ h+ [1 K* B5 ^BSA104 Business Programming – 2007: Assignment 2
% u( I6 _* u6 JPage 2 of 5/ k* K* E& m; a9 z
b) Print out to the screen all the lines of code that are the same
4 x. y" `4 {1 B2 g Include the name of the file and the line number of the code being printed for each of the two files
/ H! A% N' g. K7 s/ t* [c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared0 L$ i) i( r, R6 w! n
 the name, username and department of the user ^5 ^* @# y' t, m0 h" B1 y
 the statistics of the comparison, d* h' W) O8 G# L% G
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
; l. T3 w4 F6 o; r. ?7 n) d. d1 S the recommendation for further checking
; ~- @3 a5 k, ?) l% S- 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
4 B {* k1 i) a4 c! g the names of the two files compared
2 J; ?" H! M! _ |% [/ ^- x, ~8 Td) Leave the program (exit)7 @, x4 N9 U% J( W S' P
The ProgramCompare class: (Total maximum 20 marks available)2 b! G. r3 I" ~. Q0 U' i9 u
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)
4 j2 |2 G; L8 J6 r& C& D' g* wa) provide an error message if the files are not found or there is a problem opening them
' k0 W$ b& @0 u1 _( s. E& rb) compare each line of code
8 p6 `+ [$ K- M- V- e/ [ L) z. Hc) print out the lines that are the same# [8 x# b5 |+ m+ Z9 z# T
d) count the number of lines compared / lines the same. M5 l: p. {4 ^$ A
The AuthorisedUsers class: (Total maximum 20 marks available)) U$ ^) k7 A6 F
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)
3 g: q5 I. p" K4. Provide methods to:* `, q5 T3 E, L
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 match
, N; y2 a$ p: u$ zb) return the name of the authorised user
1 V: W% r1 X9 wc) return the name of the department of the authorised user
3 o$ \4 E' n( G0 y' `& s8 ~3 \Individual Data (Maximum 20 marks available): r0 E; d N+ }& ^. c2 t
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 ~& g2 P8 o' g3 q0 Q, l" j5 BDocumentation (Maximum 10 marks available)8 T4 \. o) T" R) @3 z4 C
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.
3 [& C! b& C% G9 F) ?; V9 w4 S. \BSA104 Business Programming – 2007: Assignment 2
8 G! n' u. _. H: B3 w- \Page 3 of 5 |
|