|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
8 b8 e! K4 }( K7 d7 MShanghai - 2007 I" v0 g, e7 u4 }- l
Assignment 25 }+ S3 l2 f/ T4 C! _, ^" s7 w
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)
9 u( E/ _- P5 l! z( K# r" i# h9 d1. 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 o- }- X# W3 ]' m, V& SThe staff must be able to:
8 I/ p1 Y. v- M9 j Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 f6 |7 ?$ `% `; [; C( 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.
/ O' p# }, ]! A' W( W \+ l The interface should provide a menu so that the staff can:
; {* s) E8 c, c3 x# { d9 |a) Enter the names of the two Java program files to be compared: f+ a% A. ~$ {$ |/ h/ e
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 z y, F+ m: S# U0 f2 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).
) C1 b/ U+ L/ e( f5 pBSA104 Business Programming – 2007: Assignment 2
7 j7 t. c5 S0 H$ v& T1 L5 tPage 2 of 57 w; V0 N9 R' y+ L' @8 Q
b) Print out to the screen all the lines of code that are the same
* E" ?8 L- j0 c# U s1 _ Include the name of the file and the line number of the code being printed for each of the two files" H3 ~1 [4 l$ a- f0 h* h- j- v
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared( y2 R& v; S. ^& Y; r
 the name, username and department of the user6 t3 D' G2 H0 P& U, n
 the statistics of the comparison) a8 C; L9 @) B- |
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different# t9 H! u4 X/ D: T
 the recommendation for further checking, ?7 n& ^& m! r
- 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 C: D W$ h( Q% N the names of the two files compared) k1 \+ M7 S. B* o0 m- ~
d) Leave the program (exit)
; a; j T% P) M O' BThe ProgramCompare class: (Total maximum 20 marks available)
7 J) s' c, x, o. P" ]' U2. 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)
$ q( [4 K+ ]% G& [9 Ha) provide an error message if the files are not found or there is a problem opening them6 `- H3 b9 T( J% D' r+ D" V# v9 t
b) compare each line of code
4 m0 t3 [7 k$ e1 ~6 y$ ?2 q8 Q9 }c) print out the lines that are the same
% t0 P' d. x( f/ E* pd) count the number of lines compared / lines the same5 n) ?9 l, z5 `
The AuthorisedUsers class: (Total maximum 20 marks available)
) ^: k) l* z7 Z# s- ]4 E' c3. 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)- D6 H& N9 M9 h2 Y, R
4. Provide methods to:
8 T0 t# T9 ]. F& ea) 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
; q( c: E: p. h' N% ob) return the name of the authorised user
. m4 s' u/ e4 k: V: |c) return the name of the department of the authorised user5 e1 w5 d2 K' J2 s \; Y k
Individual Data (Maximum 20 marks available)
0 c9 O, W' S6 Y/ V" R5 d5 q5. 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.
" X) f8 b& `$ W4 D3 ~ p2 fDocumentation (Maximum 10 marks available). W. b* k7 d+ U. M$ N( {5 U% O" a# g
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.! s P9 S! M* R y
BSA104 Business Programming – 2007: Assignment 28 R9 w7 }: [0 n2 R$ H% \. y
Page 3 of 5 |
|