|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 m# O# C3 `' r) T- [+ P& L
Shanghai - 20075 ?( ]+ P9 l, z9 M
Assignment 2
* R' h" Z1 {9 x& V- B$ a! k. ?5 SDeadline 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)
" v, U- }4 ?# u" b" x% U7 b; U8 Y1. 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.
/ g! q0 c; c3 TThe staff must be able to:7 K2 B2 M3 ~# c# H B! M9 Y$ u7 y1 Q
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.% g6 p5 ^( N3 ~/ k/ {" @
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.+ G; O6 n& B; K) L: e! e0 n: ]
 The interface should provide a menu so that the staff can:
! w5 i. |% C" B# d+ L& Z, Y+ oa) Enter the names of the two Java program files to be compared- s6 h$ _( p, {
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program. l' }$ u6 q# a+ z' G+ L( ?9 {, o+ x
** 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).
2 e% {% ~# M1 v2 _7 R' X8 s' MBSA104 Business Programming – 2007: Assignment 2
* l% p: r- p7 d" JPage 2 of 5
3 R* R' f$ o5 p* J( ~b) Print out to the screen all the lines of code that are the same
7 R' M3 X8 L, k7 G3 w4 | Include the name of the file and the line number of the code being printed for each of the two files( P1 k6 G0 q4 X3 Z
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared0 p+ A* |1 ~$ b8 @
 the name, username and department of the user
2 i: b! r2 X6 ]" K, B) { the statistics of the comparison
$ p* A7 k. S( \" Y% O$ |- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
5 ]3 ~4 f& _5 T3 x& {0 U the recommendation for further checking0 B8 S4 R" ]3 j+ J
- 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
+ l# T( w7 j0 K the names of the two files compared- h, b9 S1 A1 D3 C
d) Leave the program (exit)
: z+ b" ?6 H6 p+ Z% U5 S4 mThe ProgramCompare class: (Total maximum 20 marks available)
) k/ z8 R: _1 ~, e2. 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)8 [8 d+ E U4 P5 G, k1 B' b
a) provide an error message if the files are not found or there is a problem opening them
6 X" G3 M/ K$ t- \* jb) compare each line of code
: O" U, \. H7 E3 F6 B# X' x. A, ~" z2 Zc) print out the lines that are the same4 B' [2 n9 H1 r0 c3 {
d) count the number of lines compared / lines the same) u" K; j3 B. r. Y2 S
The AuthorisedUsers class: (Total maximum 20 marks available)
# a2 d, i, _8 l% M4 _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)3 o* g+ I6 \; |0 F8 L$ y/ T* M
4. Provide methods to:, L# Z1 }- }' q/ U2 n
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
H* t, E" D$ g+ ^) g+ F7 b; ^b) return the name of the authorised user
% u* Z8 s, @+ ac) return the name of the department of the authorised user
9 \; w) i# S6 i. j4 V- L0 wIndividual Data (Maximum 20 marks available)/ [+ u h1 Z; z/ E
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.2 i2 N6 l/ D0 @1 e/ y$ E
Documentation (Maximum 10 marks available)
- U X; H& @4 e6. 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.
$ [ |/ d1 K5 q* ?4 \5 \BSA104 Business Programming – 2007: Assignment 2% ?. W) F! ?# Y( w
Page 3 of 5 |
|