|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming ]3 G1 ~6 N" {3 Q
Shanghai - 2007
' g; S( s( l/ y& C5 n) |Assignment 2& @" X% a5 [) J$ I
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)
' }6 ~: W1 a7 o# v% P0 t) _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./ U) q; d9 M" n7 D- j
The staff must be able to:
$ M8 @! b6 ?2 L3 h Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 \9 y9 M; C1 u1. 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.
4 t+ i) N$ b4 T# d8 ` The interface should provide a menu so that the staff can:! q) R: L# A2 N
a) Enter the names of the two Java program files to be compared
$ M9 U" Y1 F$ G9 y, e% Y For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
& G. I( G, x/ ^* a+ G( {** 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).
- c4 i& h' u: C" j6 a$ \! s4 |. d& H6 JBSA104 Business Programming – 2007: Assignment 2! l3 L7 ^" s; w. E$ `: ^, Z3 f
Page 2 of 5
k- i, H- z4 V+ J+ o; }b) Print out to the screen all the lines of code that are the same2 W0 Z+ ?4 |% _& }0 X% R; [* J
 Include the name of the file and the line number of the code being printed for each of the two files
7 E0 k" p1 L' D* m. Y3 Yc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared y1 x! _( `+ G# P- e
 the name, username and department of the user
+ V7 L# `% B# u% {% h the statistics of the comparison& K' t( p5 N' j
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ x6 h; p" s; V+ a& z
 the recommendation for further checking
3 N* `1 f9 R& h! B0 ^- U) N& `( r- 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
0 e0 ^7 |" R! _/ V* l6 C. ] the names of the two files compared9 D u& V, Y- R+ n7 w0 u; Q& g
d) Leave the program (exit)
3 t& ` [3 q/ O2 s+ C ZThe ProgramCompare class: (Total maximum 20 marks available). I* {. Q* K. n, _ u
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)
4 C6 \" L8 k7 Ka) provide an error message if the files are not found or there is a problem opening them
) i8 _$ \% n2 V# w5 f4 D2 I8 D0 Yb) compare each line of code
5 G$ v% v' n8 H9 b. bc) print out the lines that are the same. e" w+ c+ O6 h1 `* r V' m
d) count the number of lines compared / lines the same* x' ^/ Q# Z" U* i
The AuthorisedUsers class: (Total maximum 20 marks available)
5 v0 w" o3 J8 f) O# X2 {1 P c& V3. 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)0 N# r& u) u0 I: L9 w3 F
4. Provide methods to:. Y' q i- S' i
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$ a) O8 u, O9 N/ `# I: s- r
b) return the name of the authorised user9 d6 u0 _4 s E
c) return the name of the department of the authorised user
& G/ Z2 l* A; s9 c* w4 r; g; a2 LIndividual Data (Maximum 20 marks available)5 E9 ?( Y8 u$ z! _& D3 O( {
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.: I; X: F% a, i5 u+ f, l
Documentation (Maximum 10 marks available)
0 m h) v7 `3 c" W4 h3 f! }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.
: |4 b1 ^( V' _5 D) }- p( H$ i$ }BSA104 Business Programming – 2007: Assignment 2
' `6 d& L! H1 g, I+ W: h2 xPage 3 of 5 |
|