|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
8 l Q% G% C8 V0 Q8 X0 AShanghai - 2007& o: j# U% w6 n3 t# n1 N
Assignment 25 ~+ X+ l- g" O8 |7 x% p
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/ W9 R( J3 b2 O, Q2 T+ W7 e4 }
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.
& |+ ?) Y- R! o% P5 e+ MThe staff must be able to:
/ m1 F2 X# X/ _+ _% D; V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.0 f- U4 J% S! i# o( v [" _
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.
% W7 y' T4 w) H+ Y9 n. M5 U The interface should provide a menu so that the staff can:
' F8 q$ s! L$ h3 k7 t1 f/ r9 e0 N" Qa) Enter the names of the two Java program files to be compared
3 a3 j' m' M' u, f8 R y# Q For this assignment, it will be assumed that the two Java program files are in the same folder as your program.* E E5 W0 E' T$ F3 D! d
** 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).
4 c* j& u2 f0 Q/ R: y" ~! i8 IBSA104 Business Programming – 2007: Assignment 2
& d8 C* y4 H# R T+ g- D2 `Page 2 of 5
( Z: ^7 G: r M+ S0 ~$ i. Y* d$ [b) Print out to the screen all the lines of code that are the same
9 h$ h8 x7 T$ V3 }/ s) D) N: ^ Include the name of the file and the line number of the code being printed for each of the two files
& J$ f! i& ^2 n% v* P; l3 n [' }c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
: }1 n" j$ ?3 V4 i4 b the name, username and department of the user2 V9 v2 g) b: a7 z4 P
 the statistics of the comparison4 v1 H- m" @3 y' T/ k- C% A- p8 H3 D6 z
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different) |. |; @1 O+ r6 s2 U% c% j$ c
 the recommendation for further checking# Q, V/ v/ L( r& S" w7 k4 ]7 i, y
- 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
" i$ I$ d: f7 \; X2 M \ the names of the two files compared
4 v9 u# _) x Y S0 D# r1 p; {$ od) Leave the program (exit)2 ^9 G! N* D! }9 R
The ProgramCompare class: (Total maximum 20 marks available)$ N6 ]& \ e5 X& 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)5 C7 r/ p, Y+ z; C1 ?
a) provide an error message if the files are not found or there is a problem opening them9 E6 n H$ _* b7 w7 F0 a
b) compare each line of code
" @: D0 F' ^% q. Q3 u$ Y Bc) print out the lines that are the same0 L( G* c# l# n* q2 Q9 E
d) count the number of lines compared / lines the same1 o; E! }1 r- ~
The AuthorisedUsers class: (Total maximum 20 marks available)
$ X+ E) {% P: ^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)& K8 C. F0 D( Q* M# G* |
4. Provide methods to:1 E# S5 b' }2 {3 `' F
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
) D8 p/ g/ h! X: Q$ Q8 |3 G Lb) return the name of the authorised user
+ U( i( u+ g5 E3 z7 H$ R e4 B3 n Ac) return the name of the department of the authorised user
7 V' c4 a* T3 m3 R" H( G; rIndividual Data (Maximum 20 marks available). X0 e% Z. h* A$ j [6 D _+ R% |
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 a* B" e8 O6 P9 q4 vDocumentation (Maximum 10 marks available)
$ I3 n3 E5 ]& o* B/ R$ S: w6. 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.
8 b5 y% `0 Z; i3 q! w/ m& q' HBSA104 Business Programming – 2007: Assignment 26 b+ L! t' m8 d: d* x/ y/ d0 V
Page 3 of 5 |
|