|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
" |0 |7 B- B* G- M8 W' IShanghai - 20073 P, M8 b! w" x3 a
Assignment 2* X# o, |2 R$ C4 @9 |. o
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)
- z/ A! W9 I& f0 L7 w% e1. 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.
4 Q- L/ m" s1 `0 G0 qThe staff must be able to:
- d# t$ u; i& H6 X# t" S Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
6 C* P7 G0 F# u0 A/ }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. m6 _* j* }1 i. c3 P
 The interface should provide a menu so that the staff can:
% s; h" f" j/ t* `2 E. ~a) Enter the names of the two Java program files to be compared
" X) y6 ]7 r' n' F4 ^% s* l6 e) X) B' z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 X7 c2 H, ?/ i5 G** 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 P1 L6 k4 F; c& M. O. g1 ZBSA104 Business Programming – 2007: Assignment 2) T8 ?& @, ]6 ^% B6 ^
Page 2 of 59 S/ Y L: l ]3 Y/ _
b) Print out to the screen all the lines of code that are the same
5 W1 B3 M: t. x) L Include the name of the file and the line number of the code being printed for each of the two files
. L4 a) K0 ?5 Z. R. Tc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared4 T; ?/ b5 R4 n; ?: R8 n
 the name, username and department of the user' K( I) G, V/ s
 the statistics of the comparison6 B. C% h( @9 q8 c" Z5 }7 o
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
0 ]2 S$ d% H: t2 T& A( h the recommendation for further checking6 z' W. s8 Q& P3 e; y- k
- 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: `/ k- U: u* R* }+ _' s0 \
 the names of the two files compared
+ v; Y0 \' J( [9 vd) Leave the program (exit)( e1 G. R* I6 {( S
The ProgramCompare class: (Total maximum 20 marks available)
% f2 G: {2 c, s2 [/ [- C0 c2. 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)
& [% M% \ U4 \5 m: Fa) provide an error message if the files are not found or there is a problem opening them: p1 Y! c5 B) E4 W
b) compare each line of code
: r1 V9 [$ B' h7 T7 @- Ac) print out the lines that are the same9 M6 U6 C" u- A5 y* w
d) count the number of lines compared / lines the same
+ Y9 {' Q6 ~3 x2 ?1 f. TThe AuthorisedUsers class: (Total maximum 20 marks available)
( q( r, k4 C0 V; g* Y3. 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)& {( L6 d* S' r5 c$ u2 ^" W
4. Provide methods to:
V4 E7 m: N* R: l+ z' ]* N- m0 Ya) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match4 a5 \. F z5 N: O4 _7 c" T$ w" h
b) return the name of the authorised user D% c" R# V1 N2 m9 ?
c) return the name of the department of the authorised user
1 T7 H# ?3 t' q0 Q* q+ [Individual Data (Maximum 20 marks available)
7 @! I b6 F% i( I5. 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.# O- b1 B% J0 J" n
Documentation (Maximum 10 marks available)
- K, U( o- n/ P- `2 _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.
' b: y/ A. Z* x# YBSA104 Business Programming – 2007: Assignment 2
+ L- u1 g% R. k: e" c! `0 I) tPage 3 of 5 |
|