|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming# ^( a. T/ x5 | l( f2 Q
Shanghai - 20072 r% q* N! p! p6 Z& V. }1 @5 U2 X/ L
Assignment 2
& s1 j' v- b$ T8 A9 M' ^: gDeadline 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)
+ a" k7 e* y+ C+ w1. 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.; _8 g: Y0 n: Y6 ?8 Q5 n# \4 }$ V5 F
The staff must be able to:9 I1 R2 U& C6 r6 c A$ q
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
Y6 P" B. @ M& u. w) C1. 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.3 I! j F6 {+ E( a7 D; R' Q5 J; l
 The interface should provide a menu so that the staff can:
' w. l# \8 b: d3 U; k3 f! ga) Enter the names of the two Java program files to be compared
5 _: @" w. C# m% |6 R- W For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 I i+ x5 o0 M3 V** 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).
2 a, { n: j" F3 O- Z7 {+ gBSA104 Business Programming – 2007: Assignment 2
8 C0 V; a4 V2 e) uPage 2 of 5
) l- w7 N) S7 G3 r; Hb) Print out to the screen all the lines of code that are the same# x7 k3 ^+ v4 A) Y7 e' q
 Include the name of the file and the line number of the code being printed for each of the two files1 X8 \8 E& o9 A1 t. J K: X
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& a/ y8 }" h' q$ ]2 X the name, username and department of the user) T3 w4 Z+ C- s- }4 a; K- w
 the statistics of the comparison. a6 K' [% O6 g1 z2 ?
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ W7 ^' [2 a: U3 N' l4 J/ _; |% z- D
 the recommendation for further checking
3 _# j& t/ \" |4 X: ]8 |$ k6 x! e- 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& H/ f+ o, P, I" q! F* @& l
 the names of the two files compared" c1 Y9 F+ C9 A+ a+ l6 X
d) Leave the program (exit)3 L' w7 f, |8 a/ [1 z
The ProgramCompare class: (Total maximum 20 marks available)% n+ a( b4 p% I3 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)! z, e2 y* z' P u% b; u) i I& M
a) provide an error message if the files are not found or there is a problem opening them0 U+ A4 Z+ B" V8 R3 [" v" w
b) compare each line of code
/ n" L" Z) P" ?- O3 G( kc) print out the lines that are the same
! e4 O% W; n1 q) q9 U+ V$ bd) count the number of lines compared / lines the same# K \, H5 |: n" |
The AuthorisedUsers class: (Total maximum 20 marks available)! e$ \) A; p! I$ E9 N& m) h
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)5 r5 N1 H' E$ j4 S2 I, ]
4. Provide methods to:* ~) U0 K9 F9 K
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 A2 j' B" z- [1 q, [: f
b) return the name of the authorised user H2 B8 X& d# n0 x8 ]9 ^' `
c) return the name of the department of the authorised user/ @& ]" A4 h. `7 j" u
Individual Data (Maximum 20 marks available)
6 o8 I$ Z# p' f( w4 z4 U7 o5. 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.
$ n+ Z( F# V6 A( }, h- {Documentation (Maximum 10 marks available)
! o* q$ W$ _, u8 ^; q6. 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., ?# N; y6 C; g4 I& x
BSA104 Business Programming – 2007: Assignment 2
7 I0 B8 k, H1 mPage 3 of 5 |
|