|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: g* c& A% x3 P; s/ O3 p/ r
Shanghai - 2007
9 D# B/ d2 W) X7 A8 QAssignment 2
& U3 N+ }1 p+ q8 B4 c& ^8 vDeadline 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)! Q- P3 ?5 I; i1 E
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.; t# i, F- H' Q, Q. \: o* r9 W
The staff must be able to:! M4 t# y1 c0 g7 I5 T
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
$ M6 F, i( F! {$ {* X6 j3 }) [0 M1. 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.
$ W) J9 ?8 ?1 e2 m The interface should provide a menu so that the staff can:- B) z3 Q2 H6 y1 S
a) Enter the names of the two Java program files to be compared5 W1 p# j4 S% J
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
5 C; ^, Z6 U# k1 _' M* S: t) 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).
, B- r; L2 r$ l( I) ~" x0 `BSA104 Business Programming – 2007: Assignment 2
) ^6 z* X/ s1 r9 V% MPage 2 of 5
4 W8 ?. a! h+ r9 \ [ A5 Z/ H% hb) Print out to the screen all the lines of code that are the same
! X& J1 s7 y# o ` Include the name of the file and the line number of the code being printed for each of the two files! x/ ]5 W; q# q4 z
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 o; [8 f- C- F6 G, r! a/ F( n the name, username and department of the user# v& T7 i5 \/ \: m( Z3 I6 t: b% o
 the statistics of the comparison( I _$ h4 b5 E' Q$ s% u% T
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
* f' }% V8 H( ?8 R& S$ L, D the recommendation for further checking( f( x( w+ c H7 z
- 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 closely6 q. g6 m: B6 U. }
 the names of the two files compared( z6 a$ n% n. I7 H$ X% O. O
d) Leave the program (exit)
! e& L# i1 c( {, r9 d- x0 x/ JThe ProgramCompare class: (Total maximum 20 marks available)6 o; l" a6 t6 r8 a( N
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)3 C ], ^3 Q4 ~0 G& P
a) provide an error message if the files are not found or there is a problem opening them4 [2 K, w" {/ G+ E- W, Z. O
b) compare each line of code
& t, B# |2 q* X2 f% H. u$ y7 Y# xc) print out the lines that are the same
# E( {2 @ O0 y5 n" e5 N6 P& f8 wd) count the number of lines compared / lines the same
) ? d4 i( Q1 i4 B/ Q0 j/ T% PThe AuthorisedUsers class: (Total maximum 20 marks available)
0 M, \; V5 D. }; N3 N" \. k1 f3. 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): Z/ Y9 p+ ?2 |, u
4. Provide methods to:
1 {$ x P: K* y7 a) b0 A) Da) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match4 @4 O3 v b- U+ O0 c% g: ^; u
b) return the name of the authorised user
+ U% t% o3 k a6 ic) return the name of the department of the authorised user8 [) }. Z v. t7 A# w
Individual Data (Maximum 20 marks available)) N- f |3 L0 }2 i% r2 R
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.
4 k2 T# S' D: {; jDocumentation (Maximum 10 marks available)* R7 G3 i+ J0 ^) P' O) G
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.0 a! b% e0 O0 ^" q, S+ J
BSA104 Business Programming – 2007: Assignment 2
( N% u, h; l! X; n# Y3 DPage 3 of 5 |
|