|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# q/ E c* K: Q+ \/ `/ I6 E8 oShanghai - 2007
+ y4 p/ o1 i9 [7 cAssignment 2
$ {% m0 Y2 T- A# s0 G3 N5 R3 Z+ aDeadline 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)6 _- l% W- P% o0 C& j
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; K0 F& [( X8 R! n& L! l+ C
The staff must be able to:5 Y2 I. ^- D% O% \& |$ _( c
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
& M" q" Z K4 y* ~8 R. A/ E1. 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.$ f7 g/ R6 d8 |# g
 The interface should provide a menu so that the staff can:
' O% G8 c1 L. t; _' k) W/ L' Ea) Enter the names of the two Java program files to be compared
q2 T, j( t% A For this assignment, it will be assumed that the two Java program files are in the same folder as your program.. x& O& N8 m1 `2 i" O
** 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).: D3 ]6 | D& t5 [/ H
BSA104 Business Programming – 2007: Assignment 2
' W! Y4 Y9 r, u4 K9 mPage 2 of 52 ]5 W. V' U6 G
b) Print out to the screen all the lines of code that are the same
6 o" R8 \5 a) n Include the name of the file and the line number of the code being printed for each of the two files9 B& T/ O" Z5 T% C
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
: _4 E. }( C0 A5 ^! z0 e# } the name, username and department of the user
+ z% z, d% Y# e T; A0 P8 d the statistics of the comparison( B+ b7 R0 q3 I& Q/ }1 e: t
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different( Y+ V7 |0 |, l4 h
 the recommendation for further checking
8 A. Z; u7 S* n3 k+ B$ @/ V- 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
( ]& L) n0 c, K( v, D9 O the names of the two files compared
+ a6 D* y; x, \# h. k Qd) Leave the program (exit)6 k$ b% Q* A4 H
The ProgramCompare class: (Total maximum 20 marks available)) A8 W1 x" T3 T: V4 L" d
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)+ m1 F2 x' f+ ]# P! |6 T
a) provide an error message if the files are not found or there is a problem opening them- E& D/ k1 }. \6 ~2 E. {
b) compare each line of code6 \# u1 S! u" i, p& y; }- d7 @
c) print out the lines that are the same/ R% F4 G+ V/ y0 M$ A7 I
d) count the number of lines compared / lines the same
1 Y: Y$ d- V8 ~The AuthorisedUsers class: (Total maximum 20 marks available)! o9 w$ Y) s' |5 {9 f8 b
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)# \3 X' x+ Y2 d F
4. Provide methods to:
3 ~) X# G1 v8 l) aa) 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
( W& K6 e) s& wb) return the name of the authorised user
2 @. j; g4 q: [c) return the name of the department of the authorised user, q( ]% m2 d1 r r( R+ o: @4 w
Individual Data (Maximum 20 marks available)
% i# ^/ ?3 _) z2 u" e5. 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.8 h. N N$ b* a2 n$ w7 R1 c V, Z
Documentation (Maximum 10 marks available)
7 a& a, n% Z! Y& s. c+ r6. 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 V+ Y% L& b1 b4 KBSA104 Business Programming – 2007: Assignment 23 x5 ^, _0 u9 k* G
Page 3 of 5 |
|