|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming# Z- V) A4 M k8 v
Shanghai - 2007- c, l7 a0 R9 x& u5 b
Assignment 2; [9 W$ Y' |1 P+ [1 Y5 k0 @
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)
% {( h" R5 g' _9 W7 F6 L1. 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 z: E4 k/ Y0 l7 s$ G h* n4 `% FThe staff must be able to:
6 O! V$ n8 p7 H8 x: V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
) q. Z0 p, k& W: r( u1. 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.
+ O: ]9 ^+ M9 {6 [' v The interface should provide a menu so that the staff can:3 \% u) D# u5 _5 _
a) Enter the names of the two Java program files to be compared' F8 e) G' a' s& m3 U
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
# Z2 {: m! R$ x' [+ ]: |** 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).$ u4 s( X6 S: |8 j3 F! _" b
BSA104 Business Programming – 2007: Assignment 2
8 [7 e! k" i. k& d& \Page 2 of 5
* F* ^! J9 J+ _. H/ c6 T0 t. J \b) Print out to the screen all the lines of code that are the same
9 O/ m- r6 a4 d1 g Include the name of the file and the line number of the code being printed for each of the two files
3 z4 U; y! k4 U- F! ^c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 s: Q' u3 j+ |/ ?) ]. @
 the name, username and department of the user
5 U# j) i. {# {2 U: _ the statistics of the comparison
; v( \2 P. T2 O- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different1 H$ a2 R% n/ Q' | D; u" I, V
 the recommendation for further checking- T Q; U% B/ S7 j9 U: }! W) h
- 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 closely4 i3 F- \* y/ P! q4 i. l4 \# E* m& E
 the names of the two files compared, T2 h+ H$ w5 i8 e
d) Leave the program (exit)
3 |- J& i" M M9 _' FThe ProgramCompare class: (Total maximum 20 marks available)% `7 j+ a' L' F+ x
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); `. O$ z& L8 i9 k. w. G6 d; a: ?
a) provide an error message if the files are not found or there is a problem opening them0 f' l8 Q9 j/ v, o) }) t
b) compare each line of code
$ e" [8 @% l; v) q, qc) print out the lines that are the same2 f2 y# I$ H+ r+ ]
d) count the number of lines compared / lines the same p: @; B, S5 e5 i% |; X1 D$ M9 d
The AuthorisedUsers class: (Total maximum 20 marks available)7 b, z3 M' J4 C5 A& f+ I0 X6 Q
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): f2 l z& t; \
4. Provide methods to: [4 p8 S' v, Z+ s+ d( p) J L
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 match3 S1 \1 H8 D1 J
b) return the name of the authorised user4 ^4 p$ @' |2 @) C: B) \4 n
c) return the name of the department of the authorised user1 L. X. ^! I# L A/ E
Individual Data (Maximum 20 marks available)
2 K b- A, \8 \$ S( E) }. Y# V. 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.5 z# i# ^. L! n b! u* k4 d( c
Documentation (Maximum 10 marks available)
. F* L0 L) b, P4 ` e6. 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." w: ~! a5 X" o
BSA104 Business Programming – 2007: Assignment 2
1 [" ^2 F5 Q- q1 m0 D7 tPage 3 of 5 |
|