|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 x5 V& d# T bShanghai - 2007+ n9 X- N: E, _
Assignment 29 s) G' P% P3 y) q! s5 U
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)
' E5 O# F# z% f# B: v( x; t$ c( S1. 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.
6 S, X# c6 }, [1 u% h% m5 P$ xThe staff must be able to:
4 X9 a% o( e& r/ Q+ Y9 z Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.6 Y% p. _5 |5 m) E, P2 A# O. I& S* ~
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.
; w- ?* u- u$ I/ X: [- b ~) {$ A The interface should provide a menu so that the staff can:4 i) |' }; d1 o4 i$ E; f+ |
a) Enter the names of the two Java program files to be compared
9 K; J+ p! Y! u6 d: n. J; Y9 q For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 T$ K. g& s8 T& Q# o** 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).
) l) L% |8 u) V4 |# N- e6 TBSA104 Business Programming – 2007: Assignment 2
& {# L! b h* ]$ n/ e1 VPage 2 of 5
- x5 y; H$ B7 c* Y4 ib) Print out to the screen all the lines of code that are the same% L# y/ G2 d- [" a: g p. s
 Include the name of the file and the line number of the code being printed for each of the two files
" K7 Y: U/ @1 s$ A3 x* ^* Zc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
" B6 g; P/ N; B# h- k* y the name, username and department of the user
* I% [# j2 n: t G( q( O the statistics of the comparison
$ l& C, h# R: ]9 M# A- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 _" S: R+ w9 I' x5 o the recommendation for further checking6 L' k! u3 _% x3 t
- 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( p+ B: U+ A) O/ A$ }' j" }9 c
 the names of the two files compared
, s1 T6 ~+ N6 T f! d5 N4 }6 B! ]d) Leave the program (exit)
8 a3 Y: S) K0 S, U5 q( BThe ProgramCompare class: (Total maximum 20 marks available)
; d7 Z7 R% a& x' d' f' A2. 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)
8 U/ f! n# O- {5 N ]7 ~a) provide an error message if the files are not found or there is a problem opening them
8 s: Q4 |8 F$ f3 n7 j" Mb) compare each line of code) q" S5 H; `9 J' n9 z m0 G& x/ t9 N4 v
c) print out the lines that are the same1 Z: s9 K7 h" P N% ~9 j, b& v
d) count the number of lines compared / lines the same
& e3 t. b# h$ L5 a/ kThe AuthorisedUsers class: (Total maximum 20 marks available)' x5 l0 H9 x W' o9 h* O/ ?
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)
0 B2 P/ K, ?% I0 m/ M4. Provide methods to:
' T& s2 f8 u- [: _" ~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
$ g' C3 y" M7 r. Q: eb) return the name of the authorised user+ P1 f5 F, O2 S0 ~
c) return the name of the department of the authorised user c `; h) _' v. J4 T
Individual Data (Maximum 20 marks available)7 m+ K6 \, t" o8 i1 b' y9 G
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.
1 X& r% l- ~: j" v7 I7 P T) TDocumentation (Maximum 10 marks available)/ n' s3 t3 R2 r/ z4 z
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.0 C3 [: t2 ~# C4 r& n
BSA104 Business Programming – 2007: Assignment 2
1 g' f5 V+ h3 v W, ZPage 3 of 5 |
|