|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 B1 e. Y W' Q3 Y
Shanghai - 2007
' s: W. P, u. C' s% xAssignment 2; R; D4 U. [$ t% C
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) D: a0 x& o) {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.# O% N3 n! l6 q1 A. C! c0 _
The staff must be able to:
+ X6 @7 ~3 P) U9 c" q Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! y5 k: }% o! r. H
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.4 h& y+ F" c8 g( | z R! S
 The interface should provide a menu so that the staff can:
1 D- G' A0 m3 i& Ca) Enter the names of the two Java program files to be compared6 X0 Y' N: K# O5 [6 s
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program. e" q& H7 h* a, t ^$ |
** 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).
4 w+ A. B$ g# Q8 aBSA104 Business Programming – 2007: Assignment 25 @* k4 ~- ~4 {/ `, h# ]. E
Page 2 of 5
3 c& L6 U" O: q: t; v# q9 z" s# ]# fb) Print out to the screen all the lines of code that are the same- p3 i' D, h9 ~: h+ m, X, Y3 I
 Include the name of the file and the line number of the code being printed for each of the two files
# g4 C( w3 h |* Q" P7 f9 Gc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
! q* R, \# ^: n4 E9 a& n the name, username and department of the user( n) v, K5 r9 t* F/ f, h0 k) @
 the statistics of the comparison! o: n, K% Y4 w/ G2 t; X
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 _& {& g6 p7 I/ w& f. F5 r/ K8 c: b1 Q0 G the recommendation for further checking' g* l5 H i8 [; p. h) `3 N
- 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
% j7 L4 {. v) U, U the names of the two files compared; R' b) ?; c( B5 p/ J1 B9 E0 m
d) Leave the program (exit)7 o* k: e# P' G) n9 ~2 h1 x, c
The ProgramCompare class: (Total maximum 20 marks available)
5 \) C; n, u; \' S! Z! U5 S2. 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)
7 _0 H' D# H+ z! n$ K& h6 s! za) provide an error message if the files are not found or there is a problem opening them
% I/ J7 H9 E! \9 g) ob) compare each line of code
; z, w# M, D N1 z' b+ oc) print out the lines that are the same
: ]0 `7 x# l+ J- `d) count the number of lines compared / lines the same+ f1 `3 L- G3 T" _' l. c
The AuthorisedUsers class: (Total maximum 20 marks available)
9 X y& a2 n& _" e0 @8 t; A3. 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)) C, b! P5 P" n( n3 o' _4 T0 P
4. Provide methods to:
' e. {' G, I1 J7 pa) 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
! ]: T! s, V" H! C9 ~% p+ Ob) return the name of the authorised user" O' }3 I7 s2 F& y B5 q; D5 b9 t) ]
c) return the name of the department of the authorised user
, G# t0 k# O+ O- l5 O4 P6 V- y {: gIndividual Data (Maximum 20 marks available)
, [1 U( o& v* I5 h5. 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.
/ \9 q2 r0 |+ fDocumentation (Maximum 10 marks available)
- i0 ]9 }8 \; b7 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.0 D) z1 a0 X1 C) P
BSA104 Business Programming – 2007: Assignment 2
4 v- i1 ~1 ?+ L, S9 A. X0 jPage 3 of 5 |
|