|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming K4 b- r2 r# V! Z) \! T/ O* M. r
Shanghai - 20076 L' _, {6 B" w
Assignment 2
R- K/ e" H3 Y) ^8 K5 X. 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 u3 @3 W* D# l& _4 L( ^5 ]
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.
0 s; ]; y! I; }/ |4 OThe staff must be able to:
, G& O3 l$ y# C( G6 s Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.' M4 e' y/ e$ {( z
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.( j8 I- ~) j" K5 d; l
 The interface should provide a menu so that the staff can:0 o e2 n) L; T
a) Enter the names of the two Java program files to be compared" p+ h1 u: F4 w7 r0 ~
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
, C. w, B1 X% `7 h8 I8 \' t** 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).) |% t+ P) B2 S8 f& H
BSA104 Business Programming – 2007: Assignment 2 T, z# w! Z9 y
Page 2 of 5+ h. J) x! G: h" f' m/ n0 D
b) Print out to the screen all the lines of code that are the same
6 J1 U: K/ R9 R: m( Q Include the name of the file and the line number of the code being printed for each of the two files) @. c4 m9 i. g6 B; o- v7 ~+ }
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared/ S. ?6 I% Z `- N3 E
 the name, username and department of the user$ ?) C, i9 |( u. m$ i
 the statistics of the comparison1 i* p! j# K0 ^% a6 r1 e
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ ]: V7 |8 O0 K0 u' H; B the recommendation for further checking; R3 F+ B0 [" j! Y$ s
- 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
- r# C W% @, }4 Z. q7 G6 C k the names of the two files compared
' [* k: u( `$ \4 W& D7 e M! cd) Leave the program (exit)
+ d- }* ]; X! }" EThe ProgramCompare class: (Total maximum 20 marks available)
4 h8 m4 u3 C: e4 Y# N2. 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)) S3 T) S( s; {" A& Y1 }0 Q2 b
a) provide an error message if the files are not found or there is a problem opening them2 c( P' N4 i3 m/ C/ C3 d+ h
b) compare each line of code/ v1 A( |1 _- _* i& v6 T" a
c) print out the lines that are the same, D- g# J, w) e/ ?) X) T. R: ]2 S
d) count the number of lines compared / lines the same
! `- j9 ^% I A6 Z; gThe AuthorisedUsers class: (Total maximum 20 marks available)
% a3 z& g8 z2 w+ C3. 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)) k# b- H- d( ]. l/ z' G
4. Provide methods to:
* c" n: F" L% H0 ~4 b: ya) 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( b: n. ?: x- m7 C5 Nb) return the name of the authorised user6 o/ Q: a6 t; X8 b7 K- g
c) return the name of the department of the authorised user
3 r/ [5 O3 c; t7 ]6 f6 fIndividual Data (Maximum 20 marks available)$ a1 j, z" c! S- \
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 A' c+ b6 A- KDocumentation (Maximum 10 marks available)% P8 q4 S6 W+ p9 ^" ^) {7 R/ j
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." j( [, E: v8 G" ?7 u
BSA104 Business Programming – 2007: Assignment 2
- j+ F% N: p1 o; ?+ lPage 3 of 5 |
|