|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming6 G3 \; \- @$ I1 J" A" j
Shanghai - 2007
2 m( W C$ F, }4 e% M: qAssignment 28 D- A# u4 L$ g3 ?. 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)! I( i: D) m- Q! n2 { @1 V
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.
7 c6 O& i" N/ {! C2 j+ _The staff must be able to:7 c( o! G& ?( @" Z" y
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
* u6 X8 M5 A, d& 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.
( @6 f) {& I) ~7 M! O: e The interface should provide a menu so that the staff can:# E( H3 n. J# v! J& t
a) Enter the names of the two Java program files to be compared% {' l8 j* P e9 V! ^1 L
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( u/ Y/ a8 ? m' T$ t$ N
** 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).
" r- j2 P; M2 B/ P, KBSA104 Business Programming – 2007: Assignment 28 k, b1 ~# ~& q A7 H3 ]2 d
Page 2 of 5
. ~) E: v. G# c; E. eb) Print out to the screen all the lines of code that are the same
+ \; L1 ]0 Y5 X Include the name of the file and the line number of the code being printed for each of the two files
. D8 ~5 w/ Q5 q# _. J* i* _c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared2 z7 l9 X6 z+ m- X+ A
 the name, username and department of the user( Z1 Y" J- x8 [2 A
 the statistics of the comparison- i% [: P# y' N1 N7 {
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different4 P7 ~+ J3 ?# _' t& l( R; I9 J# n
 the recommendation for further checking
" D5 M0 |7 a1 D& S k9 H. j3 r- 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* y o; p, X+ p! A9 r
 the names of the two files compared9 z3 }$ F& C* r
d) Leave the program (exit)
5 Q( [# p0 a! F% [9 J" F r- w: m* eThe ProgramCompare class: (Total maximum 20 marks available)4 V- b) b+ m* n* C U1 Z
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)
8 ]# U; a, ^/ H) k* ua) provide an error message if the files are not found or there is a problem opening them9 [, `5 Z+ [% U2 ?5 ?( I5 b
b) compare each line of code
* ~4 O& \- q* k* v) ?: Bc) print out the lines that are the same
7 O" ^' J. F$ ?6 Q/ yd) count the number of lines compared / lines the same
6 S* O; U( E" e: V5 D$ f8 h+ dThe AuthorisedUsers class: (Total maximum 20 marks available)) {/ A6 ?5 A# n+ W9 {+ p# ?* @% B
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)
8 c& }1 D% K$ F/ B5 r( I4. Provide methods to:
5 u* S a6 }: ^" k: U6 g( Pa) 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
. ?! U4 S$ p- p1 N! z0 ]b) return the name of the authorised user
9 K5 y2 p1 p b O, b- D5 Fc) return the name of the department of the authorised user
9 J U. Z3 U: m% n& {' k9 V3 k$ A1 jIndividual Data (Maximum 20 marks available)5 c$ _/ Z0 W3 r3 @# f
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.
4 [! X+ O4 s9 r6 XDocumentation (Maximum 10 marks available)8 u T! s% a, _4 w5 s% k& o3 H
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.. G8 L j0 E2 }: d
BSA104 Business Programming – 2007: Assignment 2
+ ?( J: }% S' H# pPage 3 of 5 |
|