|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. p* I" y+ @ A/ g
Shanghai - 2007
3 R: Y/ Q& H+ c+ t* X* h* nAssignment 2) D* f0 G, }3 _& x
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)
4 G: ?2 C( A" L" C9 e1. 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.
2 g1 G2 l. U& c1 Q" A+ OThe staff must be able to:
) C4 G G# s8 c' h0 l Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
4 t# v- J" h+ v/ w9 w; d& u5 G6 `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.+ @( ~: C& I% o4 i
 The interface should provide a menu so that the staff can:2 r: j$ Y, q! K1 Y
a) Enter the names of the two Java program files to be compared
" N7 ~! T+ `+ d5 o! C For this assignment, it will be assumed that the two Java program files are in the same folder as your program.7 s7 m- x6 t o2 r" b7 b' q
** 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).
% U5 L1 q; K4 {/ t. |BSA104 Business Programming – 2007: Assignment 2
( {5 p+ X/ S4 b+ z0 i. [Page 2 of 5
; ~- ]& l. Z, o; [- x' nb) Print out to the screen all the lines of code that are the same
! k# T4 H3 s9 P: O6 G0 d& Z Include the name of the file and the line number of the code being printed for each of the two files; s4 Q! F( Z4 J) f0 I9 a8 C
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 p4 V+ S5 |& m0 s) v! {( k the name, username and department of the user
, h* @3 Z5 U$ ]# t9 ~ the statistics of the comparison
0 H: I/ b9 _1 q) p7 R N/ k5 P3 M- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 S! g; {' b1 ]; M: C the recommendation for further checking. [/ |+ U" B$ K" v
- 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; o" I h. o9 m/ `$ w. l
 the names of the two files compared& n' T4 H' t7 D4 O8 ?( [
d) Leave the program (exit)( a& S; @% G. I. W+ u3 q
The ProgramCompare class: (Total maximum 20 marks available)" Z- Y' l, n( G( [2 F
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)
0 q; f4 {! F# v0 _a) provide an error message if the files are not found or there is a problem opening them
6 ^ i5 C. S. x2 a6 c+ xb) compare each line of code
9 |0 y, J* F$ \7 Vc) print out the lines that are the same
: l" k, O" C. @- Qd) count the number of lines compared / lines the same! s0 E/ R( @; @; _
The AuthorisedUsers class: (Total maximum 20 marks available)) @ v$ y. [' r, j
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)+ P/ t( X" ~6 y: U, w6 H/ @
4. Provide methods to:- c w3 j6 b: ]: q$ @0 a5 D
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 match0 Z4 i& {0 r+ d& M* _3 q
b) return the name of the authorised user3 D! S7 q/ c, b+ g- f! u
c) return the name of the department of the authorised user
9 Z) I! |/ R7 r2 {5 QIndividual Data (Maximum 20 marks available)
8 \" m3 \2 q+ A' c5. 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.
7 y0 d. o& W2 E& ^& z* j( FDocumentation (Maximum 10 marks available)$ ~+ w( i. v' U
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.0 @; }1 Y! q0 w+ Q4 w% R
BSA104 Business Programming – 2007: Assignment 2# o9 U% c5 c5 ~
Page 3 of 5 |
|