|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming! O- Q7 B! w0 A1 x4 O# X
Shanghai - 2007
9 n" l' R# D# W8 q; U& pAssignment 2. F* ^( k; V6 R1 c8 |) 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). y1 S( x6 L, {; K3 F% i: I
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.
; B; E; i) U0 A0 a. L9 {! U' Q3 qThe staff must be able to:& }. C- v6 _* l6 m: F' n8 s
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
, N R* {# t) X+ W' P1. 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.1 Z" R: z! P- |( k& v6 f
 The interface should provide a menu so that the staff can:% H& z) J6 h& u; f. G! V& W0 l t G: j4 V
a) Enter the names of the two Java program files to be compared7 H$ \/ b0 t' s8 _; c1 |
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 T3 d h) B1 R5 q1 C
** 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).
& z4 ~: X' |/ J! L' ~6 z( U7 S# QBSA104 Business Programming – 2007: Assignment 2
, E8 i6 G0 x5 f7 SPage 2 of 53 j$ m/ Z, S: D1 c5 X
b) Print out to the screen all the lines of code that are the same
7 s6 E5 q0 T& }% _' W Include the name of the file and the line number of the code being printed for each of the two files" g, T( |9 H, j7 U$ H2 p
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
! m+ i2 T) |: I4 m6 C$ H" \ the name, username and department of the user* G2 `: j, R) S. x) H4 T. F1 q2 Z
 the statistics of the comparison
3 b3 x! k: \' [8 m8 C0 |- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
! @ E3 V* w; t0 R. Y the recommendation for further checking* X% [1 _; ?& @7 l3 \
- 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; F4 F( t& X5 Z$ U+ V4 F; p1 u/ ]2 `
 the names of the two files compared
: c! |- h& l" h8 `9 y" n% b8 ~d) Leave the program (exit)
9 Y3 e; V. k1 c: AThe ProgramCompare class: (Total maximum 20 marks available)& E7 z, G" c0 s% c
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)
0 S: `9 U# F8 Y q! e7 ta) provide an error message if the files are not found or there is a problem opening them4 F( ]; Y9 c9 j# G! e
b) compare each line of code
7 e+ N( j: ]. {6 C3 u5 \: Lc) print out the lines that are the same- \0 o; r5 M$ Z0 ]4 i
d) count the number of lines compared / lines the same6 }- A; P& G% E& O" S' ]8 J
The AuthorisedUsers class: (Total maximum 20 marks available): [. K9 Y5 f, X2 j6 l
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)
3 j; K. O5 A0 z' z* y1 I4. Provide methods to:
2 D9 i5 l% k) ^: q& a$ l6 ~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
9 i6 k6 P4 @8 \6 |b) return the name of the authorised user; N$ ?% ]6 }( l! S3 q8 ?! w
c) return the name of the department of the authorised user4 H' v; _) t# [3 Y/ q
Individual Data (Maximum 20 marks available)
" e' F. W# w8 ?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.
& b. F% E4 j1 M4 D6 l4 dDocumentation (Maximum 10 marks available)
0 Y; e; f. s7 ^$ N1 }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.% K" f7 E9 H2 T$ w* E
BSA104 Business Programming – 2007: Assignment 2
$ d6 Q6 w6 d; p2 B/ ^; y; G5 x1 nPage 3 of 5 |
|