|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming; _- C0 {( a% o) T1 ]+ P( T
Shanghai - 2007$ k, C: Y" M, R- b( U; a: e
Assignment 2; r; V6 u# O' X' E+ w
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)2 R) p+ W+ k0 x+ x
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.
; C; f8 N1 r* }The staff must be able to:' S0 V8 Q6 `" s
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.6 K, ~8 T" i) s- l" B3 m. s* u/ x* v
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.. U5 L& |) |& }+ a0 [# b0 y% w
 The interface should provide a menu so that the staff can:
. n# x0 }% e( X" T$ w* ~0 [9 Da) Enter the names of the two Java program files to be compared2 U( ]2 {2 p1 \; U u
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
: ~8 Z6 e& X( z* t; Q) D** 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).2 t% W& V4 G; w, E% D
BSA104 Business Programming – 2007: Assignment 2" P; m! T% o& {/ X1 D
Page 2 of 5
+ x( u% u& F. d v1 Db) Print out to the screen all the lines of code that are the same3 q% H8 x. q$ z
 Include the name of the file and the line number of the code being printed for each of the two files! t" `8 \! R+ p% H9 [+ e
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 X8 a7 ]/ h6 M6 f" u9 W
 the name, username and department of the user
1 A) |% K9 y% }& p6 h& }2 E the statistics of the comparison2 |7 j. O9 Y$ @$ b; d* Y* e
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
9 ]. D' Y5 ^9 \' [, j the recommendation for further checking
: K# I* u7 y( F8 q- 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
6 ^. n6 F! `4 v5 ?' _6 h" p( w the names of the two files compared. Q' g# y/ ^: t6 [& `2 b- G
d) Leave the program (exit)! O8 v* x1 D# ?! i3 ]2 D6 _; V' i
The ProgramCompare class: (Total maximum 20 marks available)7 s9 l# i8 d( T
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)
' f6 G+ T4 y1 b; v" Y9 Z* ~; qa) provide an error message if the files are not found or there is a problem opening them
) A: @0 r! k& t3 O" @8 f& t4 pb) compare each line of code2 ~. P& J( ]) n3 B7 r' e
c) print out the lines that are the same- Z8 V( u7 w0 m7 p* a# l l
d) count the number of lines compared / lines the same
# ^" }6 Q) P6 n. ~; J* {The AuthorisedUsers class: (Total maximum 20 marks available)0 ^6 F1 [" q" V0 O: {
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)
# [$ C5 r `0 u: a- N4. Provide methods to:
) E% m% I6 T+ g. N& K0 q; La) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match9 N1 s) \* p) R3 S4 s2 ~; ?
b) return the name of the authorised user
. b C2 B3 O" N+ X9 A4 bc) return the name of the department of the authorised user1 h, L9 A7 A( o: ]2 Q
Individual Data (Maximum 20 marks available)3 ^/ K% X$ M) q. |% l% K* N/ l
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.
8 o' i; G V5 \Documentation (Maximum 10 marks available)& W: p9 t$ h6 d' w3 U4 m F
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.2 P. a( q) Q7 \ e8 `! x$ ^3 J
BSA104 Business Programming – 2007: Assignment 2
! ^2 K c ~' D9 F. U. qPage 3 of 5 |
|