|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming9 {% O9 p3 h: m6 H
Shanghai - 20078 ~+ Z5 j& R! I4 ]0 c' }6 x
Assignment 2, ^. U, F& L; P1 N1 G* e( @
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)
( V1 y; f! d% P8 N; b- K$ {% |" i1. 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.
- \; m3 W( x1 G& SThe staff must be able to:
3 T+ e$ p1 H0 [, x: G Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! y" t8 z! v# P1. 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.' Q3 {: [, W% H/ ]; D: R1 n7 E3 `
 The interface should provide a menu so that the staff can:' Q2 W8 {7 Z. y+ F8 F: i$ n
a) Enter the names of the two Java program files to be compared
5 }6 `: I7 T& x" p+ T( E) I# B) P For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
$ }; ?/ v6 |( J$ O: c** 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).
7 a- e8 b8 Y6 l; o, ^$ W* T+ c) |BSA104 Business Programming – 2007: Assignment 2/ n* X+ R4 t$ q, j @2 J
Page 2 of 5
+ z" I9 r6 m5 ?: I1 m Ob) Print out to the screen all the lines of code that are the same
. Q1 s/ S4 H( Q8 |( i Include the name of the file and the line number of the code being printed for each of the two files8 I- }9 i9 C$ J4 N' V. Y0 V) `
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; j. E6 \( `( s6 u7 u0 N \ the name, username and department of the user. `/ f5 U5 e* T$ T9 p
 the statistics of the comparison/ N+ t8 w& M8 Z" N2 k0 j
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 J% P4 N b! @: ?% k3 F- \3 e
 the recommendation for further checking ` w* i# S- p( X7 Y" T/ u
- 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
. \. d/ H+ f$ _. E* E4 Q% B" ]; C. } the names of the two files compared: \* |% R& q4 @9 z& Y
d) Leave the program (exit)7 Y6 X- _, l4 K9 M
The ProgramCompare class: (Total maximum 20 marks available)
" l- c/ x7 j% 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) J0 e/ W5 ]* c9 `% |& a
a) provide an error message if the files are not found or there is a problem opening them3 R4 b2 B/ r+ p, L* _
b) compare each line of code# y( B/ e% D! w: K3 W
c) print out the lines that are the same/ ^9 }0 x( P" A, L8 E
d) count the number of lines compared / lines the same( t9 ]9 g& g6 Q; M
The AuthorisedUsers class: (Total maximum 20 marks available)
4 W/ s) m1 h% E( L5 F3. 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)
4 F) A; T$ D* ?& ^, o. Y4. Provide methods to:
( J( m/ u0 `) J0 w8 ?5 T2 ]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
2 e: r$ B: e% z3 B2 ab) return the name of the authorised user
7 i, T7 A8 P. A: Ec) return the name of the department of the authorised user V! i0 k X9 A9 p8 r- r6 }& m! ?
Individual Data (Maximum 20 marks available)" Q1 A5 T2 K8 m/ y
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.; N! C X4 _! N& l& X
Documentation (Maximum 10 marks available)1 Z; g% `' s% z! D
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.
6 O& g6 C; u" F7 }( e. M& [BSA104 Business Programming – 2007: Assignment 2. k% k, J. z2 v9 [# y- i
Page 3 of 5 |
|