|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
- Y% [$ q5 u+ Q5 Z0 f' RShanghai - 2007: z5 L; q' l, g8 i
Assignment 25 \. x" H& f- O+ Y" D, U' n' z6 o! x, g
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)$ j: D" L9 c% ~) ^1 I6 U7 W
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.
9 M( E' v8 c* e% s. D& P) T0 BThe staff must be able to:
: x: Z7 R, t5 w1 U5 u Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.* @: q" c' ?4 b4 N% v B5 |! a
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.3 q3 d" p4 i+ h. g) a1 f( p
 The interface should provide a menu so that the staff can:
4 q$ t7 U _5 r- o& w* t5 Ra) Enter the names of the two Java program files to be compared0 R$ \9 E0 D' X' ?( |3 A3 v2 ?
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
( O' _4 d/ @2 c7 N' Y) 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).
9 ` {1 h. M2 ]3 O' l% uBSA104 Business Programming – 2007: Assignment 2% w% \6 J4 c# Y) X* u# v# W8 w
Page 2 of 5
6 h `2 V: \* j/ p/ h8 g2 ob) Print out to the screen all the lines of code that are the same. f, W5 b: P( [0 ^! P, D
 Include the name of the file and the line number of the code being printed for each of the two files, e3 c5 |5 y L1 N, {# p+ U
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
2 z1 G: `& o3 \- C! L) g the name, username and department of the user
5 c: m7 Y7 e4 P- @$ u' q the statistics of the comparison
3 Z9 v& P f) n9 {. b- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ r$ u& t7 @; h7 U+ l4 Q
 the recommendation for further checking
. ?$ B4 @2 \5 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
1 x5 t" t8 j% }- r8 i the names of the two files compared
1 V/ D/ n# q/ d! P& gd) Leave the program (exit)! x. o, H2 `) I2 ~8 h& O$ k
The ProgramCompare class: (Total maximum 20 marks available)6 Z& X& ?7 z1 E& H- ^
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)
: o! r( f% K$ R2 ?8 c" f% Ba) provide an error message if the files are not found or there is a problem opening them
7 G# W1 G) g6 m3 s" \b) compare each line of code
! P" {$ L2 t2 t, f* xc) print out the lines that are the same
9 }7 z2 V8 z) S' vd) count the number of lines compared / lines the same
+ Z& |( S$ V$ F1 m, c7 MThe AuthorisedUsers class: (Total maximum 20 marks available)
. w/ `+ \9 u* G/ w: |* L: I3. 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): S [. r; }" l* \+ a& P; U' ?
4. Provide methods to:
( i6 T2 s+ C2 ^; `" ^" Ua) 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: T* O/ @! u! e0 p: V9 C
b) return the name of the authorised user3 y( w7 a; t3 J) Y) c+ V9 U
c) return the name of the department of the authorised user
g. W e* r' I' E+ n3 xIndividual Data (Maximum 20 marks available)+ |7 W8 [. D6 v* i5 x# d4 Q
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.
$ u0 c* Z0 u: N/ J% JDocumentation (Maximum 10 marks available)! j- F6 ? B$ ?0 n
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.
J5 @2 i5 _+ k8 e6 MBSA104 Business Programming – 2007: Assignment 24 C9 W% k3 U+ R6 ?3 Q6 Z
Page 3 of 5 |
|