|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
* h& P$ ]4 [% O$ t P# UShanghai - 2007
" n( W+ J' A: mAssignment 2: k1 g, A) Z r
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)
0 q+ I1 N- B! K9 I. }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.
' W- R5 S" c' t% U% r+ ?" MThe staff must be able to:! ]1 `# p- ~7 K" q
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.% ~6 l* X `3 d* [ z3 M
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.
$ ~; F$ X/ m) Q- w) E8 E/ a The interface should provide a menu so that the staff can:
0 I" J/ w) ^- ^( U6 ea) Enter the names of the two Java program files to be compared
9 R$ ]( Z% W, F+ z9 I For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
( ~" g6 u9 Q4 W1 \, ]** 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).3 x# T7 D/ l) V: B/ ~( t" B
BSA104 Business Programming – 2007: Assignment 2
y( |5 B" G: e4 y/ MPage 2 of 5: `% w; y$ }! k8 {
b) Print out to the screen all the lines of code that are the same" [6 |$ F3 q) W" D7 [
 Include the name of the file and the line number of the code being printed for each of the two files
) B9 e9 g1 E. T' Y3 N" G/ v+ E M" lc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
0 x' i& J5 H! J2 t) j, b3 ~ the name, username and department of the user
/ u W. F, x1 `/ T" E the statistics of the comparison
6 J, O! a- d7 }3 [" `( y6 r* c4 _- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different' ~5 T3 _* }1 j1 ?! m; h4 q
 the recommendation for further checking) ]4 M/ m; w- N, @/ j: r- n
- 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 D' ]1 c: J8 w. C the names of the two files compared
8 H' r$ F! C/ O1 S+ @0 Ed) Leave the program (exit)
+ H2 P! p8 i. c( X( R; M( I$ y+ z# JThe ProgramCompare class: (Total maximum 20 marks available)4 U+ |+ K+ e. x* l5 k
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)+ ]( e( z9 p X1 ~/ b
a) provide an error message if the files are not found or there is a problem opening them
3 X% J/ A u& B2 [1 `6 h, Eb) compare each line of code
- M0 ~9 L- i9 v* e- kc) print out the lines that are the same
6 A& z( Q* F1 A4 v6 L+ }% t5 Jd) count the number of lines compared / lines the same
5 E6 H c$ f" O1 cThe AuthorisedUsers class: (Total maximum 20 marks available)& u9 D6 z- X. d+ b5 h0 k- {6 n
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)0 v7 [+ I6 ^/ H! H9 [
4. Provide methods to:, b u {% r2 E3 M5 D1 J
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
! @# c2 _7 Y. _, _b) return the name of the authorised user
}% U' Z& Y. I- i0 I$ O# z1 hc) return the name of the department of the authorised user
1 \) s) |5 V: A- |# R, oIndividual Data (Maximum 20 marks available)+ S- e% q- A* J7 s2 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." \ E1 G% E8 Z. O
Documentation (Maximum 10 marks available)
7 Z! k3 y2 d% |) U3 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. \6 M: M P1 \9 T1 I. H
BSA104 Business Programming – 2007: Assignment 2$ S Y: [) o# d7 [6 k
Page 3 of 5 |
|