|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
' K* q# [* @0 V. X/ w3 v% x2 W, u/ S8 [Shanghai - 20076 C8 F) Z2 \; n; w* r- ?
Assignment 2
0 @, _+ `6 M' i! X; t: }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)* q2 r. Z; H2 q7 _2 r- j7 }* C& ^/ l
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 `/ R, a/ @8 T+ FThe staff must be able to:
5 a! j" g9 [: v$ S6 h Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.. A q9 z* R8 M3 C: d6 Z
1. 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.+ {: m9 o7 v: w8 h3 s* G
 The interface should provide a menu so that the staff can:2 O2 r9 {, V8 G3 {$ }+ u" r
a) Enter the names of the two Java program files to be compared
+ j" W, Z. A9 K) X$ A For this assignment, it will be assumed that the two Java program files are in the same folder as your program.# \# L7 m4 m8 Z' `/ J
** 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).
* f R/ V% b2 a# m1 iBSA104 Business Programming – 2007: Assignment 2
1 G6 p, Y* P. ^% U& i" pPage 2 of 5( x1 _1 H- Z9 ^0 G, l& C
b) Print out to the screen all the lines of code that are the same: l7 ^* M: x# D* a/ a: |0 i
 Include the name of the file and the line number of the code being printed for each of the two files
* I( o1 d9 k- y* I+ w. Dc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
! r3 s9 w* L u the name, username and department of the user
; W+ u$ P% J" D the statistics of the comparison
, A+ [! E: Y* B: L6 y) t$ S0 L- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
g6 x: [9 H: k3 I, w the recommendation for further checking
% |: z5 e. ~& x+ v1 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
5 i/ F- L4 |% m' _ the names of the two files compared( Y5 h `" D8 o1 C7 P6 \) V
d) Leave the program (exit), r: {& d/ b- P6 t
The ProgramCompare class: (Total maximum 20 marks available)5 D# Q4 F8 B- [
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)
' L7 l. W' m8 K4 t" F6 c1 Z8 ea) provide an error message if the files are not found or there is a problem opening them
9 k w& X8 k! u+ X* a& L+ Cb) compare each line of code- ^& _4 m3 O6 }5 l4 R/ O
c) print out the lines that are the same
: a3 j! U# W, S) Wd) count the number of lines compared / lines the same
" G' ]8 A- \" W/ i9 zThe AuthorisedUsers class: (Total maximum 20 marks available)
3 E* \* ^3 v- M4 x: q2 n8 d3. 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)
, K; B/ |0 S- c: K& s3 [' S4. Provide methods to:
! q0 V0 {5 z% l2 _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- V. @( f( b9 v) j1 E& `
b) return the name of the authorised user4 r, O- f b; h7 g2 w' ?# L
c) return the name of the department of the authorised user
: X5 u1 G4 G" EIndividual Data (Maximum 20 marks available)+ J6 F5 ]! `7 @
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.
* ~; U9 u: k, f, iDocumentation (Maximum 10 marks available)5 y. j8 M, M( E. v0 K
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 Z3 i. _ Y
BSA104 Business Programming – 2007: Assignment 2
; s0 u- q4 W* n6 EPage 3 of 5 |
|