|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming0 F/ a9 ^, Y, Z, k6 _2 |
Shanghai - 2007
* b4 I' ?1 N8 H* N5 J/ ~: O/ H# kAssignment 2
% M) A$ S" ]2 HDeadline 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)
0 Y3 A! H+ X0 o( j1. 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' v" _" k7 C& f9 i+ ~The staff must be able to:
& s0 \. B8 ?* \5 s Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.' P3 {5 |; b( |2 {# `
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.; L* ]1 H0 y8 O
 The interface should provide a menu so that the staff can:
& Z! E: \& h% w8 ya) Enter the names of the two Java program files to be compared
% {! L8 F& u( L* c& y v For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
6 L0 Q. m) o5 z% r" V9 s** 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).
9 ]- [- U4 ?( R; j* c& [( PBSA104 Business Programming – 2007: Assignment 2/ v9 Q; l% O& y1 |6 |( T& b
Page 2 of 5
, @, ]7 b0 k: Eb) Print out to the screen all the lines of code that are the same$ P2 q8 a \* c2 R% Q/ `: T
 Include the name of the file and the line number of the code being printed for each of the two files
4 l* j1 U0 \" }6 Y7 xc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
, R) {% }& l" i& {* s the name, username and department of the user* i' b! {3 W% @6 @. `' K
 the statistics of the comparison" Q' L7 B3 f( V0 T A. m
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
! s" z( p, _! s6 k the recommendation for further checking n; N2 L0 o! Y- A: R: I. m$ _
- 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
D% p( v1 {# U9 w the names of the two files compared
; Q. z7 o, H& E3 C" Gd) Leave the program (exit)
" A& A. y4 W) r8 z' A8 k- n. zThe ProgramCompare class: (Total maximum 20 marks available)% Q, t9 |! O% E
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)1 S% I8 i4 S6 l: k/ t0 P% j& Y
a) provide an error message if the files are not found or there is a problem opening them
3 [* [7 r/ N. ~) ]b) compare each line of code
' m7 L9 `9 z2 \- U& I# _& Hc) print out the lines that are the same- N/ E% d' C3 J6 {, r
d) count the number of lines compared / lines the same
/ D1 r7 z C9 V/ X7 jThe AuthorisedUsers class: (Total maximum 20 marks available). N+ ~, x8 s& h4 B, X
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). H& j, x0 v5 p, ]! @
4. Provide methods to:8 p5 |2 g& [$ M4 B
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
9 s. l* H" K0 ]" F$ n- zb) return the name of the authorised user* X/ z4 B' D5 q, i
c) return the name of the department of the authorised user L2 T4 t: u1 J$ i1 t2 @3 t
Individual Data (Maximum 20 marks available)- f1 }+ b: C1 F$ n# j1 n
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.9 ]( g Z: Q. \
Documentation (Maximum 10 marks available). A _; O8 ]1 Y+ C
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.
/ o S( a1 P; ]9 Y9 V5 bBSA104 Business Programming – 2007: Assignment 25 |1 ^" p) t x h) U. ^
Page 3 of 5 |
|