|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
' R( ~: y! \9 T6 dShanghai - 20077 c; C8 E/ @/ u+ c) p+ t* f
Assignment 2
5 Z- @9 n& K( E, e* c( r, R4 d' mDeadline 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)
( o, q6 H7 F/ C/ N! B1. 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.
& t( ?# ]: v. u8 ?9 h! bThe staff must be able to:2 l/ @: D; V+ d
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.& \1 H4 }; G" J7 o6 N& J1 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.
$ e$ X9 H* x3 t$ n- U( x6 K The interface should provide a menu so that the staff can:
; U% {' }! X$ d+ |0 X' B' va) Enter the names of the two Java program files to be compared* G2 w/ |* w, K4 l5 Q
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: @5 x% W- _5 [ \6 F0 Z
** 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).
+ J3 q; ?. Z* kBSA104 Business Programming – 2007: Assignment 2
+ V7 n9 m( @. @- e4 Q" E1 vPage 2 of 5
/ |; D. Z( o* tb) Print out to the screen all the lines of code that are the same
2 `* @+ e3 s1 P/ h s) {7 Y) b. n Include the name of the file and the line number of the code being printed for each of the two files9 b3 H1 U( c1 T/ M! K/ Y
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
. y, S: r/ S! S1 q j! ]2 Z1 e& C the name, username and department of the user z3 K0 p3 O1 _5 k2 ]
 the statistics of the comparison z* n6 y( l+ Q" [( }& W& @% h
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different5 Z8 b4 L6 N: S* y1 Q7 o- `
 the recommendation for further checking
4 |* v; G L7 e) l# b/ z5 _- 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; k- L, P4 s: R- k# u& s0 E
 the names of the two files compared
2 L& v$ a2 B0 E% \+ ^( k( Hd) Leave the program (exit)
, H% {$ h e2 |. Y# c% J8 BThe ProgramCompare class: (Total maximum 20 marks available)
5 l, b0 u7 p8 H7 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)' B3 R& L* h& X6 Z4 _
a) provide an error message if the files are not found or there is a problem opening them
# p3 `2 x, D7 y* Q/ q Qb) compare each line of code
8 H* C2 h* g0 k2 c6 T; bc) print out the lines that are the same; M9 l9 Q9 e1 @& q7 U
d) count the number of lines compared / lines the same
0 y1 F# [5 w8 [; Y q9 \The AuthorisedUsers class: (Total maximum 20 marks available)8 Q* }7 p+ |, l5 K
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)7 R# g, P% q& E, H. h
4. Provide methods to:
0 k% m3 P1 Q5 M, F+ o6 Ja) 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
6 s* g( o3 g2 Ub) return the name of the authorised user
+ w( c, I$ \; _% r) b+ gc) return the name of the department of the authorised user: ?0 I2 y" T3 ?' t6 `
Individual Data (Maximum 20 marks available)
# `7 P2 {: d1 b7 k8 Q5. 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.
* F7 U: P. y, i6 k* u4 s- {Documentation (Maximum 10 marks available)2 y1 _/ N2 X7 ~- G Y
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.
5 E* n/ {- N2 l( k3 g& F* Z5 ]BSA104 Business Programming – 2007: Assignment 28 ^5 U l" u! W9 Y2 U+ q% O
Page 3 of 5 |
|