|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
; T9 L- R- l, k5 Y7 [Shanghai - 2007
. ^/ Q F! y* h7 W& `7 |5 y* q% C2 ?Assignment 23 h2 r- n* |& o. P
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)
, s6 }0 }5 m/ K& S) y. g) 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.
) `$ c/ ^) S$ R2 u3 U: r5 t; tThe staff must be able to:6 o$ w8 [7 H& G' c8 ? v
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.6 i. t. c( o4 ]6 d/ O4 K
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.2 {! T! h( P D4 E, _) q
 The interface should provide a menu so that the staff can:/ X+ L: f1 U6 X. q! D$ s
a) Enter the names of the two Java program files to be compared
: @0 \" r( U/ C1 F2 V For this assignment, it will be assumed that the two Java program files are in the same folder as your program.! t: J8 }3 _, o, L$ ?9 c. q+ k
** 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).
) w, Q- o' Z" J3 UBSA104 Business Programming – 2007: Assignment 2. [5 f3 H* L+ u# Z/ w0 y8 l
Page 2 of 5
/ n+ B& {! ]1 \/ Q; Cb) Print out to the screen all the lines of code that are the same0 g# Q3 {) T/ t1 q# J- P
 Include the name of the file and the line number of the code being printed for each of the two files
* [% ~9 _0 A1 ?' }5 Tc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared* |) z2 f/ e4 s0 x1 G8 z4 y
 the name, username and department of the user l6 a5 I7 o8 ?& R& l" H! ?# X0 Z g' ?
 the statistics of the comparison7 g& P4 A4 J" h# i( P4 g
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different' X4 h# w5 F% M+ _5 s
 the recommendation for further checking+ }! _( Y. u$ e# E* L2 b: r
- 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
% R4 i0 P6 x6 f, G the names of the two files compared
+ x3 L6 Z3 X+ [2 l8 C4 O( _d) Leave the program (exit)7 j9 [ \ a" h) Q% o
The ProgramCompare class: (Total maximum 20 marks available)
6 J) J9 a: Z! c6 a. J2. 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)0 m8 U9 x& J6 \; n5 G* D! H
a) provide an error message if the files are not found or there is a problem opening them
5 d1 O& O' M# R* ]/ `b) compare each line of code
5 l z# @( {" _( @; D! l. a# m9 cc) print out the lines that are the same' ^1 ]$ z8 V `/ ^; U
d) count the number of lines compared / lines the same
5 N4 N' l3 K5 v" c3 AThe AuthorisedUsers class: (Total maximum 20 marks available)
6 J- m- g7 D5 j) X3. 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; W4 x, }* ~: K* l# A4. Provide methods to:" a$ k3 q$ S9 ^8 u9 _- J
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, y- }; J. s# K( l0 y; n
b) return the name of the authorised user
' u( r' s3 l% P: K4 ^ x+ M; E1 Fc) return the name of the department of the authorised user9 }' G, ?! Q! ]% u
Individual Data (Maximum 20 marks available)3 N' G8 y5 C. F7 H) k( i
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.1 \$ R# g' ^6 v( F6 D
Documentation (Maximum 10 marks available)
; |$ [/ r {. L6. 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.
1 N5 L* n/ D0 w* V3 z' tBSA104 Business Programming – 2007: Assignment 2
7 a' C: E( |3 K3 e( `Page 3 of 5 |
|