|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ K. @1 N/ n5 l& }
Shanghai - 2007
5 K0 r* {: B' d! W' {Assignment 2
7 O# S2 n# x! a; D& {& F" gDeadline 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)
* T, @- s* J! M2 I( ^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.
" o% \1 B1 o+ E$ j5 R: n* fThe staff must be able to:1 L: q. H1 X7 |) [( _" w
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.4 D; K$ f/ G6 t4 ^( N9 W* @3 v
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.( K2 b) j$ Q, E! l2 A' y3 G& F M
 The interface should provide a menu so that the staff can:! E/ R& R! E0 v6 F
a) Enter the names of the two Java program files to be compared1 h; f7 t3 M6 j( Y2 {7 W" }
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: ~3 l" n6 ^% W' U
** 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 f% d U# E8 R6 Q
BSA104 Business Programming – 2007: Assignment 23 M, b0 q' M3 H
Page 2 of 55 v5 F \' @2 D- w' Q; u
b) Print out to the screen all the lines of code that are the same. m% f9 d0 N2 }/ E: K! P* ^ g
 Include the name of the file and the line number of the code being printed for each of the two files
( y) o: s. z6 c% s" v' wc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 b4 x7 a/ ~& ~( j+ ]
 the name, username and department of the user
4 m& z. _: b4 z7 _3 R the statistics of the comparison, J9 N* W [! b ^7 Z) w
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 P0 \- `, o& r2 T3 b
 the recommendation for further checking
V: M. c/ j8 ^9 B$ ~* O- 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 closely3 R2 X/ i7 I: x8 [% D1 C
 the names of the two files compared6 E0 y! E1 t: h2 D b8 @7 O: u
d) Leave the program (exit)
0 H7 U( H7 ~7 C6 G- D) I* B; cThe ProgramCompare class: (Total maximum 20 marks available)5 R& [" t5 p B6 x* `, U( X
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)
& @5 b+ z5 \0 o; D' X Ba) provide an error message if the files are not found or there is a problem opening them
5 `9 {# t/ w' eb) compare each line of code+ |. {0 N" [ ^1 O5 ?
c) print out the lines that are the same
. ]6 M7 v6 p. p) E( Bd) count the number of lines compared / lines the same% n" v/ q) F, F4 ^# ?
The AuthorisedUsers class: (Total maximum 20 marks available)
) X4 O3 ]* _0 I( P5 a2 d3. 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): x: X! s# J+ v7 |
4. Provide methods to:
_& b! T; e: u. Q+ N p' m+ R0 T. E) P0 b* Ua) 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
& T2 d: c$ J1 B) _# ub) return the name of the authorised user" V/ E5 W! L. s, M; b# D# m, u
c) return the name of the department of the authorised user
+ ~! Q. H) c6 X- q" ]: [Individual Data (Maximum 20 marks available)
, Y- N; W$ C; l2 V6 B2 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.+ i- M+ y& U: ~
Documentation (Maximum 10 marks available)9 O4 M. }& q/ `5 y
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.; q% b& w; E5 R) T# T
BSA104 Business Programming – 2007: Assignment 2
3 Y0 ~, t$ S+ R6 w" G3 S& @Page 3 of 5 |
|