|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
% B' K5 o9 u, f @' vShanghai - 2007
! t9 \- z2 @. y4 ~Assignment 23 {6 w- J/ r( }
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)/ k1 r7 w: f+ q5 ~ X
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.
- I4 }) r% c' A8 O! jThe staff must be able to:
) H7 W' A0 n. x8 U. [4 S9 S% v/ d F Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
& A: j2 a# y3 U! U. V; M$ g! _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.' Z3 l! K( M8 u8 w6 ^
 The interface should provide a menu so that the staff can:
: {& _+ A$ l7 |! M' S' ?* [ T8 ea) Enter the names of the two Java program files to be compared( _9 V! E" s' k- r4 j. w, Y
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
- m; c4 o! T8 @1 r** 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).1 }' [6 k9 r! t9 X9 ]
BSA104 Business Programming – 2007: Assignment 2
3 p' Y' O1 c5 U+ x3 Z7 UPage 2 of 5; Q8 s: e8 o/ K/ E, p$ O- @
b) Print out to the screen all the lines of code that are the same; h- [. B/ O1 f& }+ V7 h0 w3 a
 Include the name of the file and the line number of the code being printed for each of the two files4 n [! F/ o% \4 G! q
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared; W! T' Q: d8 J0 z
 the name, username and department of the user
5 r( |( S* M. a4 U# n/ X the statistics of the comparison$ A/ I9 m1 t8 d3 h9 v
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
" R, w: U. {; P the recommendation for further checking
! h* O K4 j" K, D" i/ R) _3 t- 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! M1 K# V! J1 F" K9 P
 the names of the two files compared5 ^5 |8 m7 }" a4 m6 A1 D
d) Leave the program (exit); A4 j( S2 K E2 q% u4 S- x. g
The ProgramCompare class: (Total maximum 20 marks available)
7 h I9 k' u! K2 u+ L- h% w2. 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) a3 Z$ M# {& `3 ?5 X, @# I" ]
a) provide an error message if the files are not found or there is a problem opening them1 U' @; i! J) P5 j- D. H
b) compare each line of code
, m n; W' v: X N$ Qc) print out the lines that are the same
1 D( B# S0 Y) }) x1 _d) count the number of lines compared / lines the same
# X9 W' o0 \: g qThe AuthorisedUsers class: (Total maximum 20 marks available)
& f! \6 X/ C% l# b3. 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)
* _) ^+ j. \# s# T4. Provide methods to:
; b" R% o1 y c& U3 Ka) 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
7 U2 `- M7 e: |- s; f7 ?- ^( yb) return the name of the authorised user
I3 q$ p* ^( o* J2 }: Qc) return the name of the department of the authorised user: `0 K' u8 u( Z# V" O4 p& t o
Individual Data (Maximum 20 marks available)
/ j5 T7 V2 ?3 n2 r5. 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.
. I# u9 d( D" |6 L2 BDocumentation (Maximum 10 marks available) M0 Q5 O; Z! q7 U( R
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., K3 S$ k/ {: P0 z; l \5 T9 a
BSA104 Business Programming – 2007: Assignment 2" E6 O, `: p; Z( g& i
Page 3 of 5 |
|