|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
- Z: z5 D1 X( ?Shanghai - 2007
* L4 }4 M. U) c; y8 X1 HAssignment 2
$ b* m* d5 f6 F% 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)7 r0 p+ J+ a0 e0 ~7 V9 q
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.4 G: b+ o+ k& e* N$ G/ N
The staff must be able to:
2 d3 }% _: ^7 d6 k9 P& ~$ k' z Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
8 x0 t4 ^+ \8 N c" w1. 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.7 v+ _. p* _. h6 V! W6 z6 Z
 The interface should provide a menu so that the staff can:. w& j! F; `6 \- l1 s/ E& \2 h1 M1 Z
a) Enter the names of the two Java program files to be compared
0 t, P6 }1 A1 G- P- e For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
+ G0 V; o6 C- r** 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).
( I4 U, O( L. M# W' FBSA104 Business Programming – 2007: Assignment 2( \1 Z) ^ b9 j4 i
Page 2 of 5
1 q7 g. {! t7 A; i# ]3 Zb) Print out to the screen all the lines of code that are the same
: X% t; d. Z D/ U! M5 R Include the name of the file and the line number of the code being printed for each of the two files7 i3 V+ D/ s6 Y1 U
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared9 p, O4 a& K% B( P& G
 the name, username and department of the user
4 Z+ y7 B' h+ ] the statistics of the comparison
! O' d8 `+ {. B/ [6 ]; a3 q- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different4 c* y V1 L+ W# a6 G% ]
 the recommendation for further checking/ v( J& p8 G# K. i# I( M9 G2 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
0 [2 e# G" z: }5 h' Z the names of the two files compared
& L1 {2 u. b4 ?# Q4 e, T* Md) Leave the program (exit)
# t/ ?, `$ r% @% I9 d' @The ProgramCompare class: (Total maximum 20 marks available): n" [8 K8 \' s# s% ?2 B) s2 a
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)) c, k+ d8 X4 [ n: A! V
a) provide an error message if the files are not found or there is a problem opening them0 A/ p$ ~$ {, n* f4 B n
b) compare each line of code
2 P0 p W( C$ B% ~, M* @c) print out the lines that are the same
2 [' t% Y- q2 A/ \5 K$ ]d) count the number of lines compared / lines the same7 o% Y0 S" ?+ f( R
The AuthorisedUsers class: (Total maximum 20 marks available)
- x; T; R( P: d1 Y: p# }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)) T. P7 N5 X- r
4. Provide methods to:' z+ r9 F! V) P& @; Z# F5 ~
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. n& {, z% ]( G
b) return the name of the authorised user9 K2 h) S3 m% u7 Q$ X" [5 V5 {% i
c) return the name of the department of the authorised user$ V: d8 b! q* O* A$ _3 S
Individual Data (Maximum 20 marks available)3 O7 N* M- \. `% d$ ^) k1 \
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.
. ^3 L$ R3 f+ F6 ?( fDocumentation (Maximum 10 marks available)
6 P8 y5 o7 C* X& W6 b$ p6. 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.% ?' j3 c1 B( {4 m1 u
BSA104 Business Programming – 2007: Assignment 2
2 A5 M+ m5 n6 rPage 3 of 5 |
|