|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
5 _5 U3 `) M3 ]7 b- K/ D( UShanghai - 2007
5 B( N2 u9 E) ]4 p* e: U1 ~Assignment 2
. X* C4 A4 h/ b8 U7 [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)
9 l2 e; N& _7 ]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.
% R V& f5 k$ E( o- c |The staff must be able to:% L3 a! S% D; v x1 y% H$ r4 E! P" V
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 @( w/ B. {' d/ k6 q+ y& q& g E1. 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.
& _7 }, U; {7 S+ |, P The interface should provide a menu so that the staff can:' x* {! n! ~" w8 |0 g. x
a) Enter the names of the two Java program files to be compared0 T' q# o0 Z9 X: I J% X
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
, B+ o3 |7 G3 @; \4 `** 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).
9 v- d+ e3 L4 ^8 ~2 F" UBSA104 Business Programming – 2007: Assignment 2
- w3 l! L( d% _, S7 |Page 2 of 5: {% G. b8 n% x! H1 v) {
b) Print out to the screen all the lines of code that are the same
6 d' I6 ]5 ]" ~1 r Include the name of the file and the line number of the code being printed for each of the two files
, c6 k6 q) t2 ^c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared1 W( K6 C* F5 D: W! d7 x
 the name, username and department of the user2 t2 l3 R0 W. b& E. X
 the statistics of the comparison
/ p. v$ s2 w% _1 d4 M; l1 L- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different$ ?! L9 L x8 l- l6 Q. w, ]
 the recommendation for further checking
1 [4 x2 I9 Y$ K4 M- 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/ p( ]5 P8 ]& n- s the names of the two files compared
- k9 H& b5 c0 Qd) Leave the program (exit)8 U4 N1 u0 t4 z% B
The ProgramCompare class: (Total maximum 20 marks available)
O7 v6 c x* |1 v" x8 m2. 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 J2 L+ n1 b3 C9 F; y1 N6 |, h
a) provide an error message if the files are not found or there is a problem opening them
% O; t; D. T* o0 d! t* Lb) compare each line of code9 {0 V! a: P" V% L& n( I3 y
c) print out the lines that are the same
& u9 @. E) f; W9 W% _3 Z- Sd) count the number of lines compared / lines the same
% E/ P) W7 g5 i/ w, @The AuthorisedUsers class: (Total maximum 20 marks available)5 v3 n7 o+ h& Z! h8 f$ R
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)$ v. T8 d" D# O5 M, { H0 B: k# d1 b" L
4. Provide methods to:1 H' E" o/ H( ?% M( U
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
# L8 T5 h9 x7 ab) return the name of the authorised user4 e/ t- H! h! \$ W6 G1 k
c) return the name of the department of the authorised user! I+ w- Q- m# n1 h" h
Individual Data (Maximum 20 marks available)
5 S' {7 {/ d. p! ^5 m e" g5. 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., ^; N4 t' `+ n- V8 p3 c* W
Documentation (Maximum 10 marks available)+ C! b+ o; c: x& u- J
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.5 x; b! c L3 I+ H3 s
BSA104 Business Programming – 2007: Assignment 24 b- A! T$ l7 j
Page 3 of 5 |
|