|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
( d% k2 Y. T5 j; r# @; ~Shanghai - 2007* [" B" F8 q, {3 ~# v: l4 ]
Assignment 2/ K+ k2 x* `0 F
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)
0 m& {4 |5 g+ a6 ?9 R9 B2 `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./ [# V0 A" b( W1 F* X H" C/ E$ C
The staff must be able to:
5 `5 ^9 y7 G) l8 B! U Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 R; D, e3 e; Z5 m
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.$ ], J4 T3 S" q
 The interface should provide a menu so that the staff can:7 E; j0 O3 E7 s. f9 S
a) Enter the names of the two Java program files to be compared
6 i6 R2 R b8 {, c- g+ r For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
8 g4 c( D7 D( U1 q** 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).
7 U- ? @7 t5 z; F6 YBSA104 Business Programming – 2007: Assignment 29 A* k( ?$ v) G1 Y0 t; S, o( g
Page 2 of 5
" W7 ?' X5 U: d- r M5 m6 u2 kb) Print out to the screen all the lines of code that are the same
0 ?0 [; U! A7 d, G& Y' R Include the name of the file and the line number of the code being printed for each of the two files0 ~: _& n5 u3 X7 A: [# i Z' }
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared1 E7 }9 n/ x9 W: R$ p
 the name, username and department of the user
5 O1 M, w4 Y) C a- [) p5 E) L the statistics of the comparison7 C# i4 O; _, s( |- [* L3 T0 m
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 ?5 |# e% [$ A( H( B6 y2 {) i
 the recommendation for further checking& f: y* ] _8 @+ N; i; ~9 p
- 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 [9 j3 a: L, I7 b C the names of the two files compared
& h9 u( ?' ] ^' k6 r- @, zd) Leave the program (exit)& o! m5 w; h3 W& r$ Q* Y
The ProgramCompare class: (Total maximum 20 marks available)
& O6 G. v/ v8 H1 t' P4 ~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)* W" h* f. { B; m6 Z# z
a) provide an error message if the files are not found or there is a problem opening them
; O y% w/ I( Y! o8 ~' Ib) compare each line of code
5 R; B/ x! J; u/ `5 O- Bc) print out the lines that are the same8 s: w$ _ l/ m! a) s$ Y$ o( f3 ^
d) count the number of lines compared / lines the same+ l6 t+ `; y: }; m7 p
The AuthorisedUsers class: (Total maximum 20 marks available)
! M3 w7 w- W8 a" t3. 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)
- G9 M6 j! g: P# h0 f. {4. Provide methods to:+ d& n# e& I( ~
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$ J: M0 ?5 R# C; S
b) return the name of the authorised user5 A! S5 `: n4 g J- e. I
c) return the name of the department of the authorised user
6 q" w* _% h' j" ?Individual Data (Maximum 20 marks available)4 I, Q, N) @* A4 u7 d% L1 v. ~- Y
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 m( z; l- ?* f( d: s; bDocumentation (Maximum 10 marks available)
! J& l% T0 A) X# g1 K/ t+ G6. 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.
- ?- c$ v6 A" q: R5 _5 RBSA104 Business Programming – 2007: Assignment 2) @. n4 U8 N! x2 P
Page 3 of 5 |
|