|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
7 Q" C6 z& l+ a) P. V+ P0 aShanghai - 2007
! f6 p, c$ Z2 WAssignment 27 n4 s2 {$ Z8 N* @. |8 m: N$ ]
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)
/ t, S4 H9 C2 q4 ~+ e2 a3 ]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.& V; S- S8 D4 L, h2 K& f1 O
The staff must be able to:
U; C: t1 D% W Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.; s# {) i- L; L3 d5 b& p; Z
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.5 H4 P* n0 Y) A' |& L
 The interface should provide a menu so that the staff can:
6 ~2 B! u) a1 q& e/ K; xa) Enter the names of the two Java program files to be compared; k( f4 c9 S* W: Y' ]- E
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; g4 M1 K9 [( T* Y4 m+ K5 |' J3 j** 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).
+ n9 y, t" {. i) p1 z) {& P' z1 |BSA104 Business Programming – 2007: Assignment 2, b/ [8 P7 ]' s- f$ H8 I9 Z
Page 2 of 5
{- F' C2 J6 O8 xb) Print out to the screen all the lines of code that are the same
1 ? n: C# I: L, U& c* O ^) d Include the name of the file and the line number of the code being printed for each of the two files
# a( K3 H1 e% n/ F" T6 Mc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 h0 W3 o, _3 r- G
 the name, username and department of the user
! H1 Z8 v& `: M! J* L1 ? the statistics of the comparison
- O# }; ?" ^* b- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
# n8 Z& {) D$ ` the recommendation for further checking
+ j% l, k8 b2 H0 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) i7 T) _- g# M0 \+ C, H
 the names of the two files compared) H3 L& C5 @. N7 X$ x
d) Leave the program (exit)
* C$ i/ q# P TThe ProgramCompare class: (Total maximum 20 marks available) Z6 q7 g. ~, x1 e |' `
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)
. S. w3 \3 G7 K2 [" ka) provide an error message if the files are not found or there is a problem opening them
3 H! ^4 b+ U O" e$ _b) compare each line of code
( U! V( K2 ?! F# Nc) print out the lines that are the same
# v5 q: N* v$ Q/ nd) count the number of lines compared / lines the same
9 p b; y9 K4 {6 [* @; L5 a" bThe AuthorisedUsers class: (Total maximum 20 marks available)1 [, J& R6 S8 d) N; h4 j* j2 \. e
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)
$ Q1 `1 \5 c9 V4. Provide methods to:& z5 t4 ~$ A# N0 E6 d4 [; _) P
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
: L# _2 {: n6 D2 i eb) return the name of the authorised user
1 `9 j2 e5 D5 I% \! T) Yc) return the name of the department of the authorised user6 z/ S, |7 L; L% J
Individual Data (Maximum 20 marks available)
# H' m8 v, [8 R+ o8 q* G3 T6 D* z: ]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.# O: a \ q' R$ _1 p
Documentation (Maximum 10 marks available)
1 E( k B% f/ v* D$ U9 Y" i9 s6. 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.
0 [2 Q( X8 t7 u7 }BSA104 Business Programming – 2007: Assignment 2( ^. M) L+ M& b$ m. d- h" Q5 V$ Y4 j
Page 3 of 5 |
|