|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming* G$ Y" B/ B q6 ?- C) N
Shanghai - 2007
* G( y) N! r L6 jAssignment 2
2 g* S Q( [: L7 Q! c1 @2 FDeadline 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)" o$ o }' ~6 A& k& [7 {
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.' k; f, p: C0 S6 \. ^% k9 c
The staff must be able to:
: s# |% ?8 g2 d4 i" P Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
, N$ O: ?" e1 v7 r9 i! H# P1. 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.6 q- _2 X0 `4 h( t$ H% } A
 The interface should provide a menu so that the staff can:) h. I! d2 `3 |
a) Enter the names of the two Java program files to be compared
/ T) }4 l1 G/ E. c& T' t For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; A' u0 o% }; k, F** 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).: [& G8 g1 X+ }$ u% M/ n* E6 f% N' \
BSA104 Business Programming – 2007: Assignment 2
6 o0 t0 c6 K3 I" l# Z; b1 i2 LPage 2 of 5' S9 }) c! X& q& f3 x; v
b) Print out to the screen all the lines of code that are the same: n7 z7 {4 A6 D7 Z% \
 Include the name of the file and the line number of the code being printed for each of the two files( A; a, w( Y( e: T
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
3 M- P9 n2 Y6 J' O" q' R the name, username and department of the user
& Q" b5 d6 K) G the statistics of the comparison
2 n* Y7 A" f* L6 y: h0 v- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different' x# _/ W+ H- f6 \5 v: W0 ] I
 the recommendation for further checking3 N* G7 v, a& @' a
- 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
9 h. h8 {, _" O1 Z the names of the two files compared
$ Q0 v6 ?, ]' R4 W1 d( ad) Leave the program (exit)% D( u/ N: m8 O* t+ _" B
The ProgramCompare class: (Total maximum 20 marks available)
7 E8 [. c. K, ~5 S; u* D2. 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)
) _1 u5 j; K( W7 Ha) provide an error message if the files are not found or there is a problem opening them/ I( H; b1 D) P7 v" X( ~
b) compare each line of code( W- f! U2 O: a/ ~. f J' x
c) print out the lines that are the same3 d+ I; ?" S% C8 q9 w- o
d) count the number of lines compared / lines the same
: d( @: M: ~: U+ n9 DThe AuthorisedUsers class: (Total maximum 20 marks available)
9 w& w9 _2 e: z3. 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)
2 b4 l, |; Q& C( ?2 I, B# `# T4. Provide methods to:
* y3 j# S: w; ^: C& G: |$ m+ Va) 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, m [3 ]! q; V7 ?. `' u% c$ o
b) return the name of the authorised user
( {1 x0 O) s* G |+ B b0 N" uc) return the name of the department of the authorised user" n2 ]0 f3 x3 b* K- W
Individual Data (Maximum 20 marks available)
; A+ N/ T2 r. J& Q s) f3 R2 P0 x: j5. 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 M2 p- _% @4 N; wDocumentation (Maximum 10 marks available)
: h% J/ v8 b y' j6. 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. d( ?# E) V. O2 H
BSA104 Business Programming – 2007: Assignment 2 ^6 g; \6 n$ I' `6 g& ^" F4 {2 V1 M
Page 3 of 5 |
|