|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming% W1 C$ h4 L2 i# c# ^
Shanghai - 20072 p" K4 D% u6 O3 Z) r* ~
Assignment 2
1 A, N/ U8 c0 ^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)
5 R& `: i) j( v. |8 w1. 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.
* k' N/ W3 V* p! E' S, f: h& d, CThe staff must be able to:% B8 H# q. U8 Q ]& H
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.* L' \1 @5 ^5 R8 ?/ k" J
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.
T' E0 w- Z2 Q5 ~& H$ S; N. p* ]$ { The interface should provide a menu so that the staff can:9 ?4 x3 H y9 }! O# D4 i' S \
a) Enter the names of the two Java program files to be compared
X/ y6 R: V9 A! A& Q& k For this assignment, it will be assumed that the two Java program files are in the same folder as your program.9 | X" q0 O* P! w9 v: ]
** 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).7 y; j: [8 W4 g+ w2 d
BSA104 Business Programming – 2007: Assignment 28 P2 Q1 ^- i) U4 M4 S# P
Page 2 of 51 t/ V0 c, E9 y" r0 @8 {
b) Print out to the screen all the lines of code that are the same
; U! s3 p1 V5 i: s/ Z Include the name of the file and the line number of the code being printed for each of the two files8 @3 f: Q: A6 I9 t8 [$ p
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared+ \ N' G: y/ M* X
 the name, username and department of the user
% \" @1 f) l6 G( n7 z9 b% n the statistics of the comparison
& u6 z+ A' ]7 F! l" s `/ s- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: x, w+ Q3 @6 \8 @3 L% ]- D2 I
 the recommendation for further checking1 x) w3 E6 @1 v& j9 \
- 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 y6 w8 K8 [0 g, F- x7 B: C the names of the two files compared6 |! v0 S) Z( F2 D$ v) c
d) Leave the program (exit)
* s2 y: b( x, \The ProgramCompare class: (Total maximum 20 marks available)
# `1 D& X! n8 x# T2. 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)
& P4 }2 J& [ m, }" Z0 m( Ca) provide an error message if the files are not found or there is a problem opening them
# J5 Y; u) H& c% Vb) compare each line of code
, y8 q# d B! ]/ t7 \# ?4 Rc) print out the lines that are the same
- s% ~; O% l7 F4 e% S8 Qd) count the number of lines compared / lines the same
$ u: Q- b; k# Q# c% fThe AuthorisedUsers class: (Total maximum 20 marks available)$ D( o9 T0 \& K' L" N6 _ Q
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)
7 _3 L( I/ Y2 H% n2 v: D4. Provide methods to:
. ~' b9 K! q1 _& Qa) 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
, g. H4 I% o o7 Wb) return the name of the authorised user# T% h- x" y) o7 S( o/ b
c) return the name of the department of the authorised user
/ `( X' i5 w% M" V+ A1 ^Individual Data (Maximum 20 marks available)
3 N6 C( Y5 Z @! }: S" s6 h5. 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.
" F7 n$ }7 \; @6 m! u; g2 vDocumentation (Maximum 10 marks available)( |' W8 ~; v+ I& D* z0 P
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.9 t" t+ s5 Y1 u
BSA104 Business Programming – 2007: Assignment 2
' ~, n, Q+ i: b7 @; i: {! hPage 3 of 5 |
|