|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming1 Z, K( |: ?' }) ?% Y d. v
Shanghai - 2007
* i& O5 x* r) }8 uAssignment 2 L- n& {; m/ H1 I% h
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)7 V+ S. M$ b7 }4 F( \
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.
7 \! [; ]0 q0 b* \4 v# z) QThe staff must be able to:
7 v3 y, h. f* F Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
" x3 [# k8 }. w6 j9 I% h1. 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.
6 `, g; h3 O. ~ The interface should provide a menu so that the staff can:5 ?! p0 m( k4 l9 f3 {
a) Enter the names of the two Java program files to be compared
( q" P0 \2 v+ e* s For this assignment, it will be assumed that the two Java program files are in the same folder as your program.2 X/ i& q! Y9 r ^* f% p7 V, N
** 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).
8 o) [, {) ~; G/ X9 ?BSA104 Business Programming – 2007: Assignment 2
4 u2 R, J9 q: x; MPage 2 of 5
+ x# t* [. I6 i5 hb) Print out to the screen all the lines of code that are the same
% h( D! k9 Q p# {4 r5 h Include the name of the file and the line number of the code being printed for each of the two files
( ^: }, G# D! K' B& p4 t, Lc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
/ y, b o' X6 _1 Y* \ the name, username and department of the user6 l, p8 Y: V$ d7 Y4 t6 Y
 the statistics of the comparison5 k: H; x" a( v. E
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
: O2 W: a5 _! u9 r! e! @6 n the recommendation for further checking
/ r; T8 p9 n* ?7 A- 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! F/ C) m) W' E" q
 the names of the two files compared
" k! _- S- R5 L3 P& m, c8 _d) Leave the program (exit)
( a- F( H+ B" n! ]. W+ j/ yThe ProgramCompare class: (Total maximum 20 marks available); R! s( D6 L# Z+ _# l! S
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 X8 L5 F7 f! q- m. g5 U. W8 K G
a) provide an error message if the files are not found or there is a problem opening them
+ I1 O; Q6 a; F0 z* L7 H" o* Eb) compare each line of code0 I; g- t* i5 v' E
c) print out the lines that are the same
" C9 K3 f* a! _9 o: `" @d) count the number of lines compared / lines the same+ Z' @6 @% ^+ x, y4 @# [8 o& N
The AuthorisedUsers class: (Total maximum 20 marks available)8 S; O( y) M" O& R+ l7 S# {2 p7 U
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)
f+ Q& ~; j! Q5 C7 U4. Provide methods to:( l9 u2 d8 N- l- D9 G
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
, E% }* Q2 |8 @' r' `b) return the name of the authorised user7 w1 E% ~, h! F9 ~5 Q
c) return the name of the department of the authorised user1 P( K" i: D: F8 ?2 b4 |
Individual Data (Maximum 20 marks available)# f# r: m7 M' i( A6 }
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 C1 q& ^9 f" Q6 k; {7 A' Y
Documentation (Maximum 10 marks available)
" z) y: M0 r8 e( L1 M, A; _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.
- k0 ^- H) j$ P- m0 @, iBSA104 Business Programming – 2007: Assignment 2) d1 z6 I" h( D+ d3 e2 ^# H
Page 3 of 5 |
|