|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
) ?) t! c6 V. X1 x" Q7 H0 a4 ZShanghai - 2007
. k; O' {; C) I# ?Assignment 2, `/ @% `6 K2 C1 m. m
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)
& @) i7 \) Q+ \* h9 \& s1. 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.
8 ]0 Z- B E( ?5 c2 i) VThe staff must be able to:3 f* @; r: q, ^: T
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
' i8 o$ T" g6 _ N O1 w1. 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.& q, y8 U5 Y8 U
 The interface should provide a menu so that the staff can:
7 V* `% |& `- ?+ J9 D2 i: F8 {, ua) Enter the names of the two Java program files to be compared
L. m4 V& ~5 w* T, j For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
+ E. F3 ?. N# R( ?** 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).
; v) g( [* F) A; W" r3 bBSA104 Business Programming – 2007: Assignment 23 P; G. P2 _* N, M& X
Page 2 of 5 P! Z4 ` K' f+ [! I$ S6 U6 `
b) Print out to the screen all the lines of code that are the same; w* G8 ~' Y9 O+ x* p. S/ i
 Include the name of the file and the line number of the code being printed for each of the two files* U% A" o, Z; B4 c, y: Q& j: L! t
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared9 i5 T) B7 k0 S5 K' l
 the name, username and department of the user! f6 f3 z0 G* c
 the statistics of the comparison m Q+ T0 s" C6 Y
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
* y7 p) F; F! r: t the recommendation for further checking$ ^: v* I( S" w, 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 closely2 z6 a' r3 \" r+ V+ S4 }0 g
 the names of the two files compared5 O* a7 ]* j1 f9 a# b
d) Leave the program (exit)* c+ r6 D3 U. i7 f! F, r( Q
The ProgramCompare class: (Total maximum 20 marks available)
5 ~& F: G C, k& c! H1 _* z+ D+ G2. 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 S% \, }4 l! `1 na) provide an error message if the files are not found or there is a problem opening them
2 y: a i$ B6 ]! o/ ^* ?) T+ Jb) compare each line of code
r% l7 h+ R3 v: ic) print out the lines that are the same3 y& _: L s8 l( j3 [
d) count the number of lines compared / lines the same
/ W& M5 y3 U# J1 m+ u0 vThe AuthorisedUsers class: (Total maximum 20 marks available)) Q8 z! f5 Q, Z( f
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)5 i% S( ?8 u. h3 R2 |0 l
4. Provide methods to:
5 h4 T3 R0 F/ j4 ta) 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 J' [: P& p5 w9 I% d9 Y( D
b) return the name of the authorised user
' G! H( L& B4 d5 C% Mc) return the name of the department of the authorised user
7 T- ]; m7 ~3 D+ ~* [! J7 ~( ]Individual Data (Maximum 20 marks available)/ |# E) {# R4 b1 l0 m* Q) q N
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.5 B5 m1 W; C, H! |
Documentation (Maximum 10 marks available)
$ n# s& W4 s4 V$ G+ l" [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 L0 n+ B- T" I8 |" f7 z
BSA104 Business Programming – 2007: Assignment 2
* Y# b& z9 f( p+ nPage 3 of 5 |
|