|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming, M0 v% ?% G; l1 c9 @; x! l1 j
Shanghai - 2007' ]) a, k t/ L4 [3 v8 M7 L
Assignment 2
1 z3 Q) \& o& m5 wDeadline 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)
2 K% M2 N$ P) R! G$ Z, S1 k1. 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.
5 T3 m# } l2 m! d; Y, }! GThe staff must be able to:
' Y: {! B( R; q a+ o Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
$ E+ A4 s0 f4 y8 n$ Z6 q8 H# Z1. 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.7 C+ r% M4 F% r9 Q
 The interface should provide a menu so that the staff can:
: O3 E% g/ d2 s* T# P( ~a) Enter the names of the two Java program files to be compared( B0 e4 h' q# |/ G3 |; ~
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.. T/ z, L- n2 l2 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).' x* J- N g7 N- p6 f
BSA104 Business Programming – 2007: Assignment 2
* T q) ^; u$ O* k) b2 n3 CPage 2 of 51 o8 V' s" B" k# L$ I
b) Print out to the screen all the lines of code that are the same
" {% V* o" Y0 O( t* J* N: T Include the name of the file and the line number of the code being printed for each of the two files7 g& Q5 `: [: F3 ]) ]) \
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared" k& P9 w- E0 q( W( X9 d
 the name, username and department of the user
# u& h" B2 C+ l8 _. ?( m the statistics of the comparison
( j: A5 l/ e+ d' ~- c- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
$ K6 U0 R$ w" h1 {. N3 B. P the recommendation for further checking
+ Y" \: y- }, w& v G @+ B- 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 closely0 I2 \' o( M; b4 i& J H' W8 }2 S
 the names of the two files compared4 n" e+ K6 i9 d/ |9 k$ N2 ]
d) Leave the program (exit)! N6 b- S" [' q3 A' A
The ProgramCompare class: (Total maximum 20 marks available)
" }# Y( s' i$ I$ w2. 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). O ?# H' z1 d3 \
a) provide an error message if the files are not found or there is a problem opening them
# B8 r& l" i; n! d r; S: ?# cb) compare each line of code
. g2 v7 ^ ]% ]" zc) print out the lines that are the same
6 D4 ?* m o! D" _0 [7 {d) count the number of lines compared / lines the same
: g F/ T8 B- Y! \; `% y6 a) AThe AuthorisedUsers class: (Total maximum 20 marks available)
# _' |8 i* }) t3. 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)
9 _4 ^8 z$ @1 i) j) V4. Provide methods to:! u0 C# m& f5 M$ N e
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 match6 B, x0 x. ]! O2 h1 w
b) return the name of the authorised user
/ U# T( o2 y c8 Qc) return the name of the department of the authorised user
6 D- m' E( U, Y& fIndividual Data (Maximum 20 marks available)
7 n( f2 |# P5 F8 n$ `" h5 S" o; s5. 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.
+ ]3 a- f+ g: I. t3 I7 T ^Documentation (Maximum 10 marks available)( S+ {1 Y6 D* a9 Z; D8 X, u/ b
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.* n5 ]) T9 X7 e8 l; y
BSA104 Business Programming – 2007: Assignment 2
7 l0 G8 k& k, {Page 3 of 5 |
|