|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming7 X, } |7 J) V! I
Shanghai - 2007
, x4 B/ g* h: o; O$ nAssignment 2
+ X4 a y( M7 P) HDeadline 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)
0 C/ Z6 n3 D0 d5 A/ \$ M1. 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.
# i% C! u& t. V- y/ GThe staff must be able to:
2 A/ P3 u' c+ ~$ K Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
9 l- M( b$ ^7 @+ b7 s2 i1. 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.0 p4 w5 c: y( P8 T/ B: Q5 y! H$ |
 The interface should provide a menu so that the staff can:" U& S. K4 u3 { S; S2 r6 t% }: K
a) Enter the names of the two Java program files to be compared
( {0 r) o; s1 V2 \ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 W, c" i" \# q! [/ t& 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).
( g- g: o8 \1 t4 U7 o- D7 w" v. YBSA104 Business Programming – 2007: Assignment 2: A* X6 G: e( g+ v
Page 2 of 51 r! p7 v( B- t5 S7 o( Z
b) Print out to the screen all the lines of code that are the same
& K7 H8 J h# L e; L Include the name of the file and the line number of the code being printed for each of the two files
& M* N, F1 B/ ?; {* ?7 n; G* cc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared3 A6 T& z6 Z/ S6 t- Z) y! d
 the name, username and department of the user/ O, l* f8 ^* U3 g
 the statistics of the comparison. _$ m5 I! e E9 l, ]! |, r
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different# W& z( m# b" n5 w6 @
 the recommendation for further checking/ R+ p, \7 e6 i/ |6 B8 k
- 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. }% q) o# E# G) w/ X, x& f
 the names of the two files compared
% b9 s9 z8 _- p5 T. w/ Sd) Leave the program (exit)
( O% {7 l2 K8 T7 D/ J3 n6 vThe ProgramCompare class: (Total maximum 20 marks available)
+ [/ p/ b; X4 N5 F' ?& u2. 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)! d* k4 ` I% W+ g/ @( s* L# j
a) provide an error message if the files are not found or there is a problem opening them* Z) h! I# V9 ~, g, t# Z
b) compare each line of code% D6 \; D$ O2 [0 u. G
c) print out the lines that are the same
! m# }5 W* v3 T% c1 x8 jd) count the number of lines compared / lines the same
! Z9 n4 U1 g1 NThe AuthorisedUsers class: (Total maximum 20 marks available)
' v% j6 V/ H9 ]! `0 k6 z2 [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)+ {% k9 y1 @+ f9 ^
4. Provide methods to:
) ~* ^5 G k, m6 [0 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 match$ F4 d; y* |; O( d
b) return the name of the authorised user
+ ~4 k. n5 X4 b' Z# q8 Pc) return the name of the department of the authorised user. _( _: [" }4 T
Individual Data (Maximum 20 marks available)7 _0 g) b, ~4 b6 F4 _- m4 f5 s
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 x5 Y- ]8 u& w% v& a3 k: Z
Documentation (Maximum 10 marks available)- L; A4 ~ t$ V' S; a2 Z3 M8 }
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.
1 k/ o8 i( P- kBSA104 Business Programming – 2007: Assignment 2. P$ h( b E) h% G
Page 3 of 5 |
|