|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming1 J" ?2 V$ `$ W o( F* K: ~ p9 o0 ~% s6 `
Shanghai - 20075 G( B4 M3 I/ v
Assignment 2
* E) I* Y) {+ I) j# HDeadline 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): W% Z7 ~( A; t3 `, N
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.* `7 G7 g& |3 E, |$ f. Q. D \
The staff must be able to:: l5 t+ W# r! P, a: {6 F
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
9 G: u% s" L- C, H2 j4 Y1. 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.
i- M4 v6 ^! J& R, b/ C5 ]/ f. M7 i The interface should provide a menu so that the staff can:) E6 {1 p& H) \) l
a) Enter the names of the two Java program files to be compared, a( u. t) g$ q- Y4 c
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.' m$ z' E" n1 W, ^+ m4 L% @: n
** 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).$ Z: d, s% z1 w1 k( z: _8 Y4 w% l
BSA104 Business Programming – 2007: Assignment 27 S+ |9 |6 j5 _/ t: Q8 o# r
Page 2 of 5
) I2 v. J& P! A3 Ib) Print out to the screen all the lines of code that are the same
6 E/ l; I/ Z% E, H Include the name of the file and the line number of the code being printed for each of the two files/ Z/ C! b& ~7 u! l
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared8 g$ K1 w B% ]; D) ~
 the name, username and department of the user
4 y% Y+ @+ o6 {" o8 X the statistics of the comparison
* W9 S- ]2 ?$ H, j" s8 [- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
4 w) P- C8 i% I; I& U4 B5 F$ I the recommendation for further checking
4 `$ z2 E) j9 q2 A- 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 closely2 q. I8 b- j0 S
 the names of the two files compared5 t) ~% ^; }, `8 y
d) Leave the program (exit)0 Q" a1 y$ w4 c' k1 m
The ProgramCompare class: (Total maximum 20 marks available)
! |: }6 I4 l4 k% m) b4 i, W2. 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 b g( Q: J g
a) provide an error message if the files are not found or there is a problem opening them$ e. V1 t6 b6 W7 Y$ o1 |
b) compare each line of code! ~* `( u% ]! c' j" g
c) print out the lines that are the same# `! S3 x" B8 P; G7 a" V* T* Q2 l
d) count the number of lines compared / lines the same
) d6 z2 _4 b+ y- U# m# J2 wThe AuthorisedUsers class: (Total maximum 20 marks available)
; a2 M Y; O' n9 q" ]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)
+ s1 E; m4 G5 t! s2 v( Y$ e; ~8 r! ]1 C4 a4. Provide methods to:0 y5 y# r' \$ E* e
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
3 a. p" b7 s/ T& L1 `$ ^9 Pb) return the name of the authorised user
: D& q) v- M( ]c) return the name of the department of the authorised user) g! t# r! X4 [, A& s! _
Individual Data (Maximum 20 marks available)( Y4 y9 N$ x5 d
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.
6 t4 V S) j4 q0 SDocumentation (Maximum 10 marks available)
6 Y. `) |! [' P# a6. 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.5 A+ V5 s, d' c5 a/ W0 f
BSA104 Business Programming – 2007: Assignment 2
7 A; m( X2 b4 @6 C3 pPage 3 of 5 |
|