|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
$ W2 X/ R1 o0 A! |4 }6 {. kShanghai - 2007
) M3 F) \* T) z, v7 LAssignment 2. z' B) i, T9 G% |) Q+ ?
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)
' k* [! y4 B1 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.
+ O( M2 ~$ J- q4 f% AThe staff must be able to:
) ~! R6 ]$ T2 F2 j& P5 N% R Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
# |# A4 W$ ?' e$ C% L- q/ N1. 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.' j2 `, A7 J; P+ [
 The interface should provide a menu so that the staff can:' ^7 G8 k2 O i! y* u5 }7 [
a) Enter the names of the two Java program files to be compared
- }9 D+ D. h. a' t: n For this assignment, it will be assumed that the two Java program files are in the same folder as your program.. o# ^" a/ `) g: L( `
** 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).! T% U* C9 ?. ~$ a" Y9 q
BSA104 Business Programming – 2007: Assignment 2
, K0 }2 I* {) G3 A4 KPage 2 of 5
+ B5 G9 w' H2 s8 gb) Print out to the screen all the lines of code that are the same- r- T4 {' x& Y
 Include the name of the file and the line number of the code being printed for each of the two files5 `+ S+ b& D3 L" l2 N3 X" p% l- f
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared7 p U! N4 j1 m3 o) h6 g, Y
 the name, username and department of the user
; Z3 p" W# ~; T" p0 `( G the statistics of the comparison3 u H C5 N$ o* n$ h* [
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different1 n H# F$ |5 {" ]
 the recommendation for further checking
* E% l$ k) B. M1 A8 W1 {0 x- 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! I; H% D. U/ k0 r- |$ Y
 the names of the two files compared# D) H4 g* R) b! e! R
d) Leave the program (exit)
2 P9 W' |( b2 J. @The ProgramCompare class: (Total maximum 20 marks available)
$ \! E& B6 W$ e2. 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)
R) S6 T4 h1 t, B0 l9 E: O7 c+ Ma) provide an error message if the files are not found or there is a problem opening them
. C- }2 J* X( P: |' V7 m0 vb) compare each line of code
! f' k$ C1 X: A; \7 m+ \: Qc) print out the lines that are the same
, g; k# t2 m- [0 v$ Nd) count the number of lines compared / lines the same
" R: y; m% E; D w! K7 k' i4 OThe AuthorisedUsers class: (Total maximum 20 marks available)
" x4 [5 l# F! Y0 v1 Q+ q/ J3. 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 X; B0 `. |! Z( \: Z/ O4 ?4. Provide methods to:
- ]8 P1 z- j) h; Ya) 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
. \5 k" A* E o* ?b) return the name of the authorised user# Y/ W. y1 C1 y' a, E/ K: U; p) Z
c) return the name of the department of the authorised user
2 u9 J. `9 {& ]( BIndividual Data (Maximum 20 marks available)
8 X9 ]! g9 d9 E% A5. 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.7 |) R) b+ t$ s- @& V+ B
Documentation (Maximum 10 marks available)
- N4 y2 O, \, T! l. S5 r/ e4 T; G6. 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.+ L7 V- b2 D. c, O. v: `
BSA104 Business Programming – 2007: Assignment 2+ z$ W; g" S/ y4 O. ~0 [7 D
Page 3 of 5 |
|