|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ s- m5 L' R- L9 \5 A. H
Shanghai - 2007
, L1 x' N% R6 O4 E$ L- F; Z4 sAssignment 2
8 b8 r2 T0 z. H, t8 MDeadline 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)" c8 V8 j0 j! B$ V5 {3 v
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.
; Y( F0 I8 [) E0 C, MThe staff must be able to:
6 V* _5 E" m. J Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.9 _, r7 B9 B# c
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.8 c, v1 Q+ ]. J, \9 c
 The interface should provide a menu so that the staff can:
8 ~$ |# q4 {6 L' T3 J: u- oa) Enter the names of the two Java program files to be compared, x# w9 B' ^* i( J8 @1 r: d1 W
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
: J* F% X3 `; U5 Y C/ L. y3 u4 d** 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).
4 ]' a. Q0 J$ PBSA104 Business Programming – 2007: Assignment 20 G# i/ c+ h1 l+ s$ [. q$ n1 r% {
Page 2 of 58 _3 o3 N4 b+ |; A7 r
b) Print out to the screen all the lines of code that are the same
% F* y) N+ _3 n0 ^ Include the name of the file and the line number of the code being printed for each of the two files
& {2 Y7 g8 s. Q( ac) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared4 K' T8 e/ R9 [8 _# x
 the name, username and department of the user
. I) F- Z: Y( T- a8 C6 v the statistics of the comparison* a& M/ W( v1 {2 ~: F
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different% ~) `2 F0 ?3 z- N4 K
 the recommendation for further checking
5 R( D) z) I+ D. P& S- 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# \5 F( H4 ?8 n4 H4 Y L; X
 the names of the two files compared8 r5 Z( A: D7 W! i9 p5 S
d) Leave the program (exit)
, [% y2 O( r! F0 k3 ~% E, ZThe ProgramCompare class: (Total maximum 20 marks available), I6 X' N% p- z: [
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' o9 ?% J: U Ja) provide an error message if the files are not found or there is a problem opening them
6 F" d: S @; c$ c, Rb) compare each line of code3 Q5 {, F% t5 j) t
c) print out the lines that are the same
# M+ E2 C4 ~) Z: l: ^d) count the number of lines compared / lines the same7 R) x+ d3 S5 N% u
The AuthorisedUsers class: (Total maximum 20 marks available); o3 L, T) d3 D9 n) }
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)
: i% Y$ \9 R% v2 W: j( a" g4. Provide methods to:5 e4 `' ~: j+ @, `. ?! [: A
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$ J+ K/ T* T, q0 c, A
b) return the name of the authorised user
+ C- p5 [, P' z, k/ u# E' h5 rc) return the name of the department of the authorised user9 i5 K) ]: l( s9 h( F
Individual Data (Maximum 20 marks available)
/ N( ^ t2 X" S0 D- [: Z3 W5. 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.( L2 o% ?- O9 z# n% p) m
Documentation (Maximum 10 marks available)
- C" K0 |, n" P1 ~* {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.5 G6 Z1 v: C/ D0 f5 c
BSA104 Business Programming – 2007: Assignment 2' i1 p i; Q: K# U# S8 o8 E9 m
Page 3 of 5 |
|