|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
+ k+ |0 Z& F D% P. O: lShanghai - 2007" A$ R3 B) W3 [9 [3 e
Assignment 2+ d5 E9 y+ U. D
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)
3 g, }2 y. ]5 i$ F& M- z1. 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./ c+ I4 [2 I9 v0 {% Q7 D F! A
The staff must be able to:4 _! w! c# I' a! Y
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.* }! r* |1 X0 x. p! `" `/ L
1. 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. ^' M; ^) H+ r; ^6 O
 The interface should provide a menu so that the staff can:
& T" m2 _! E5 E& ma) Enter the names of the two Java program files to be compared- [6 J+ C5 G0 r7 \. _ c- S
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.4 g3 Q. i4 Z# ^, c% K- B1 r% U
** 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).
% V$ n }' M. ^) w8 u9 aBSA104 Business Programming – 2007: Assignment 2
% u0 d- u: k; K! H9 q" x' m7 Z8 r& |+ w gPage 2 of 5
9 n$ ^, _9 f' B: D) F/ a* c; Pb) Print out to the screen all the lines of code that are the same
2 O) x+ g/ j) h Q3 r4 e4 A# w4 Y Include the name of the file and the line number of the code being printed for each of the two files4 t+ U' P. p% y# S; C( W: @2 Z
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared/ \8 y. F3 G) s+ D8 L; ]
 the name, username and department of the user
4 K' ]! J/ M0 q4 E0 R( Z the statistics of the comparison
0 K+ r1 s7 b" C- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
7 V$ ?7 L' Y, s the recommendation for further checking
6 M, Z0 ~3 O( p- k- 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 l1 v( R4 L& Q; D7 W the names of the two files compared* S" S" F' M. E6 J8 _3 T/ w6 W+ a
d) Leave the program (exit)
1 l8 J R! Q% O! o4 A) Y9 ^) KThe ProgramCompare class: (Total maximum 20 marks available)7 X) T$ C9 ^+ U% `" I6 L% ]( a' g$ z
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)" x: Y) N. I7 i- l* A$ |6 Z% i7 S
a) provide an error message if the files are not found or there is a problem opening them
8 }. N8 n& g, ?6 eb) compare each line of code
* w1 ]1 E v" l5 t, l( ~5 pc) print out the lines that are the same. Q, X; r1 i3 q" J4 P9 R
d) count the number of lines compared / lines the same
- }' u* [2 N5 D# C% YThe AuthorisedUsers class: (Total maximum 20 marks available)! N3 q& {0 w9 T) `" T1 b$ p/ o% a
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)5 z1 S4 p" ~ {1 f1 b* J: e9 _7 R
4. Provide methods to:* B& s7 w: ?& C, r; X3 C
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
, \3 r! q4 ~' c7 `: V6 v, x9 B( n+ Rb) return the name of the authorised user' x! n$ f% Y, \
c) return the name of the department of the authorised user
; Z1 ]% D4 _) S6 Y$ g$ lIndividual Data (Maximum 20 marks available)
6 N) D" U. K& R A5. 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.6 W4 S1 r2 b/ h, [
Documentation (Maximum 10 marks available)
3 g5 I. f* ]( p- K6 f6. 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.
+ Y. F8 y6 L, U& F% Q: d. ~: X& lBSA104 Business Programming – 2007: Assignment 2* T, @- u$ d+ ~+ v4 w
Page 3 of 5 |
|