|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming8 b; V, X6 y x) H; r# [ o
Shanghai - 2007" Y. A2 z$ l% @) D
Assignment 2
9 Z# Z& A0 f- @. RDeadline 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)% e0 w5 a8 o* C
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.
4 u# F" {- y( J! O" @+ S1 xThe staff must be able to:1 i. R& \; m4 ~
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.! W* Y' W: B6 Q) x
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.
1 `5 o$ S7 I- \: Y$ P! w The interface should provide a menu so that the staff can:
# [& g7 {' t: [6 B- J4 v! w2 Za) Enter the names of the two Java program files to be compared& a1 q$ G8 ? c; H/ B% k
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( s1 K/ n* `0 B, q I1 f/ R+ h) P
** 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).3 l+ A5 T$ I! Y- I% w7 l" I
BSA104 Business Programming – 2007: Assignment 2
# T2 K5 x. j8 ?4 T/ B- }, t; zPage 2 of 5
! m H& ~% L3 }! Hb) Print out to the screen all the lines of code that are the same
; D' Z7 M7 G* X. q. r Include the name of the file and the line number of the code being printed for each of the two files
1 R4 ^$ y [; j% Tc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; h2 i9 B7 y' L" y the name, username and department of the user% y/ X' ^! ]+ i' H6 R6 G- U4 a; C
 the statistics of the comparison1 ?! g- y. G# ]/ G
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different% Q6 p/ K' ~$ W$ T& C2 v; N; N2 Q
 the recommendation for further checking
8 u y" C3 ?+ v: \& W' J- G- 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
3 n2 K" `: d# w* C the names of the two files compared
# C- X! @2 x# {! ]1 J6 n: |# V9 ~d) Leave the program (exit)
& M' i3 h \5 A$ F% T; R( aThe ProgramCompare class: (Total maximum 20 marks available)
% ]& P9 P( C% \7 v+ Y3 u& `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) s$ k, }0 X0 j' Z+ _
a) provide an error message if the files are not found or there is a problem opening them
) V0 V8 ]2 F% l: z, E( b& \9 ]1 `b) compare each line of code
* G; t6 _; j$ Q9 z% C* Lc) print out the lines that are the same
' D x# k" H7 p" O7 Bd) count the number of lines compared / lines the same+ W. e6 E' R0 L- r( z4 n- H; s
The AuthorisedUsers class: (Total maximum 20 marks available)
$ T& b3 L' _- ]+ ?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)+ o0 Y) }) @* M$ l) Z5 i
4. Provide methods to:+ h! ^8 h* R3 s3 O
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& T! m" |. V& ?5 j- H. L1 _
b) return the name of the authorised user
( G1 {2 z0 D; w; q4 [& Uc) return the name of the department of the authorised user
, p9 k& W M# r6 e) A! zIndividual Data (Maximum 20 marks available)5 w1 i. s3 ^% o& g, E/ S. A
5. 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.
G _" F9 }% O) U1 a3 D! u4 z5 WDocumentation (Maximum 10 marks available)* Z# d; s7 F# C1 j
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.
" G X( k' S x/ _BSA104 Business Programming – 2007: Assignment 2/ s$ x# `3 n0 t& H' ~
Page 3 of 5 |
|