|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
2 }' E' C! I$ U/ {! G& E1 O* Q' ZShanghai - 2007
8 M! I$ d+ Y+ A8 \+ ^Assignment 2: }: P& h9 W0 W& j2 k$ J" I
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)
& r( p$ Y! k: H$ k1. 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.
2 V" F: O; Y" b$ u* Z( ^The staff must be able to:
, J! i3 j) c. W% G! b Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 F1 {# {9 z1 q3 Q( R2 @. Q a1 z2 C1. 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.
. W" e* V9 D- Y% r' ^' e9 s The interface should provide a menu so that the staff can:+ `% }/ `% z& c9 S) m6 Q0 {. p
a) Enter the names of the two Java program files to be compared! g5 a S. k3 ^, w! L/ x1 V
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 _0 U( R) W. M# a, 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).( R$ {( q- v3 P9 F; Q: ?: U4 X% D
BSA104 Business Programming – 2007: Assignment 27 I% J! `( @5 n
Page 2 of 5 O! c6 J$ I6 \1 ~5 P0 C; O
b) Print out to the screen all the lines of code that are the same
. I: U4 H. C& `5 k) C- J Include the name of the file and the line number of the code being printed for each of the two files- l' o2 n$ p! f: r
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
" T8 Y$ c0 H5 g, u2 B# @2 R5 I the name, username and department of the user
4 l7 }0 w+ k) b( Y( g4 ]0 g the statistics of the comparison* E2 a5 c' F+ z8 d2 W
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
4 R0 S& l. F# K' w8 t! X the recommendation for further checking
0 H ]3 u4 G0 U/ 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
2 A3 s* s2 }8 L2 C+ Q' \& F1 G the names of the two files compared
1 j$ l" n) U. a1 od) Leave the program (exit)# Z! v4 p4 x0 y. y' `+ L" q
The ProgramCompare class: (Total maximum 20 marks available)( D' T# ^" n( w) 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)
! ]# ?3 q% t, I# Q1 xa) provide an error message if the files are not found or there is a problem opening them; H" h9 _" f- E1 Z- l b% K" i
b) compare each line of code
" n& t/ Z: ~& U6 R2 s w5 Nc) print out the lines that are the same
% }1 z7 X# E5 md) count the number of lines compared / lines the same" z4 O E4 o' j0 D
The AuthorisedUsers class: (Total maximum 20 marks available)
5 T: M/ N/ _ p( v* [' ]+ V j3. 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)
8 `2 ?0 e9 c% v0 _) t0 s" {4. Provide methods to:! r$ ?* j4 m- n2 F
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. x3 D$ n* N4 G! T
b) return the name of the authorised user- d' u& Y, Q9 W8 \. e! @) l+ l
c) return the name of the department of the authorised user
! ?) Y: U. N n/ `, xIndividual Data (Maximum 20 marks available)
- K% A, {' C& e5. 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- M" @: x+ I0 V
Documentation (Maximum 10 marks available)3 c6 V h9 F. S2 k' W4 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.( e6 B: r1 T; B1 |" O9 o" ~
BSA104 Business Programming – 2007: Assignment 27 Y$ v" O/ M! ]7 N. m3 H
Page 3 of 5 |
|