|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
0 g0 r5 K! N2 k1 BShanghai - 2007
, x8 R' j! ^7 I( F3 e: X& W' T) vAssignment 2
+ J: Z3 M9 F" J' ^$ e2 ?) v" W* tDeadline 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# G8 B+ M/ M9 }; K8 @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.
: R. d" }; L" @" w! wThe staff must be able to:
) [( n/ b) [$ v9 I+ u& f0 R1 f Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 [ P5 _1 b7 _$ ]1 ]9 b4 D1. 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.) M1 I3 |! M. B( ~, _
 The interface should provide a menu so that the staff can:7 |% l! w- b9 f! I7 V0 s
a) Enter the names of the two Java program files to be compared
! X: m6 b2 A8 } For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
' b/ t* g+ ?, ~** 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).8 k+ ~! N( ~) P( ^" \
BSA104 Business Programming – 2007: Assignment 2! A# L1 D$ D0 ^# f" W% b8 ^3 O
Page 2 of 5
8 L5 o8 H; [& A8 j$ J: xb) Print out to the screen all the lines of code that are the same, X) p9 O$ e C0 s/ S
 Include the name of the file and the line number of the code being printed for each of the two files
) `- J7 \+ T6 @ ~& ?c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
/ q' E8 B- }. M: t5 [( a3 i the name, username and department of the user
% G5 Y; z4 }+ P |6 B the statistics of the comparison6 s* O$ F: h4 a6 e# ~
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different) N `6 }4 q) u+ p1 u
 the recommendation for further checking
9 `% \4 e9 _2 u% 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
2 C7 M- L6 @8 \+ D9 G: ? the names of the two files compared
X6 f% b0 |! f- y9 o) yd) Leave the program (exit)1 Q, x) C! o& T. o
The ProgramCompare class: (Total maximum 20 marks available)
5 R) t6 v) `6 x- t! v, o. {9 _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)% f$ f g ~8 _7 y* m- b0 A
a) provide an error message if the files are not found or there is a problem opening them
8 D/ ` u& r; p8 V- ^ Zb) compare each line of code3 ~7 m& Z& K4 o* B r
c) print out the lines that are the same; \1 p; l0 P0 O9 {2 e
d) count the number of lines compared / lines the same! A/ N) X; n3 N( }, E* v+ N* Z5 s6 g. ?
The AuthorisedUsers class: (Total maximum 20 marks available)/ |7 h/ \1 ], I9 a6 ~& ?! s
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)4 Z) O6 z' t7 t5 {
4. Provide methods to:
2 b G/ Y9 R+ p9 w( V( o. ^1 Z3 {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 match& u) H2 G9 ]! {3 q9 t( n
b) return the name of the authorised user
- f( q h& Q- `0 P: ]4 b% Gc) return the name of the department of the authorised user' e# K( p1 p2 V# C
Individual Data (Maximum 20 marks available)
+ n4 T) }* { s) 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.& ~; C5 P# W' {- f9 _
Documentation (Maximum 10 marks available)5 F% q/ J2 L( h; u; o4 h( s, B6 q
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.
8 J# B8 F( Q+ u b8 Q! N" \( {BSA104 Business Programming – 2007: Assignment 2
$ l/ D2 A4 t* d- ]5 k9 ]Page 3 of 5 |
|