|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming) c, w# S; W Y- ~# Q
Shanghai - 2007& ]+ S4 E" b, Y3 c: N3 J' @
Assignment 2% a) C$ t0 T9 c' E
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)& U8 O0 S g% {$ c7 u8 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.
" R) F- ~: b+ ~! GThe staff must be able to:% L5 v9 a3 R9 f
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
% G% N c, l/ q$ i2 u" d1. 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.1 A' K. x3 I0 K! _
 The interface should provide a menu so that the staff can:1 k3 K$ J) B q
a) Enter the names of the two Java program files to be compared% r# R4 L+ F1 o
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 [$ {. U p+ 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).
( p4 w+ D* B% v* s6 \% h# t- a- P: E* HBSA104 Business Programming – 2007: Assignment 2
' U. i- ?2 n5 B' BPage 2 of 5% |* Z( J5 X5 t: d9 c" _( P- q
b) Print out to the screen all the lines of code that are the same
0 M# p1 W% c7 T- q5 o' @! b Include the name of the file and the line number of the code being printed for each of the two files
9 Q0 [% Z$ e2 r6 {. Kc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
) Z7 K6 V r G* J% W) [* j. \ the name, username and department of the user
" P7 E4 F7 B+ G. C: z1 o the statistics of the comparison( I5 w% ]( [7 ~* W, ~) W
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different% L' y* L6 [" P9 m+ S. v m
 the recommendation for further checking
8 u% ?* Y: `& E! x; g9 a& S- 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
3 `+ U8 X4 |# T# q, G% ? the names of the two files compared) ]$ w6 L( J. d+ V/ J5 o
d) Leave the program (exit)
' t; n: v- w; e+ p" |The ProgramCompare class: (Total maximum 20 marks available)9 M9 P2 Y K6 T7 S8 ^ v
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)* u* g* K+ r7 k) q3 ^
a) provide an error message if the files are not found or there is a problem opening them( @% ]6 K8 O4 C
b) compare each line of code9 ]& K9 ]- Q" b4 n/ i0 M& T4 [
c) print out the lines that are the same+ F2 Q! {6 _& b2 I
d) count the number of lines compared / lines the same! w4 W7 l' o) \& V$ \
The AuthorisedUsers class: (Total maximum 20 marks available)
! b& t- m6 }- _2 J. Y3. 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 o ?% v. Q6 y" Y% b
4. Provide methods to:
0 N4 F/ N: ?- u3 g Ia) 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
) z( t' y- t9 lb) return the name of the authorised user. ^7 `1 _* B7 a- p3 K7 f% V
c) return the name of the department of the authorised user, s+ K: {' Z9 X+ R
Individual Data (Maximum 20 marks available)- @5 z2 l+ E4 C- B: ^
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.
?0 w* H6 W/ e0 `+ J, @/ ODocumentation (Maximum 10 marks available)9 }4 i- g! ?8 H5 V
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." C. l6 C0 W0 X; X8 i
BSA104 Business Programming – 2007: Assignment 2! {" n( O, U" f6 E8 }; P8 n
Page 3 of 5 |
|