|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming6 ?7 A2 O' f2 A
Shanghai - 20071 ^' ]: |* A) n8 ]2 ^7 V
Assignment 2
' |1 F7 }4 ]3 r" D/ s" ^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)9 [" b4 I- q6 ?: n$ i- R
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.) d ^9 Z9 E m3 q
The staff must be able to:
( c% p; F, v4 F5 ]/ O Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.: S0 F1 b" r6 z) ]( ] u
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.
3 n) A0 P2 e6 B2 a9 |6 w( c& F The interface should provide a menu so that the staff can:
7 Z& B0 K$ t1 |0 z# Aa) Enter the names of the two Java program files to be compared( G1 s& q- g1 w7 x% d
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.& i4 g, C% _& w! h2 q, M. }2 {
** 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).
' n% B( P7 O8 C- lBSA104 Business Programming – 2007: Assignment 2 ~! l8 t" P) W
Page 2 of 5
/ D0 [1 P: {, G; |' h- o. V. k/ U. sb) Print out to the screen all the lines of code that are the same% n `9 a( j! U) s; m
 Include the name of the file and the line number of the code being printed for each of the two files- E0 Q3 e4 D9 S% ]. `3 `
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared# y' Y* [! F9 g: S
 the name, username and department of the user2 P* \, V% O, G, Z5 l2 M4 A0 c
 the statistics of the comparison# s1 K/ @% Z2 i0 B. v0 S
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 q) `1 G/ g# @' j
 the recommendation for further checking2 s3 {4 p. X4 ` q- Y' T l
- 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$ |8 \% Q) @) g7 @* y$ c6 D: B
 the names of the two files compared
7 s) Z8 M* x, bd) Leave the program (exit)
0 d* ~2 t# N& m; W, [The ProgramCompare class: (Total maximum 20 marks available)
+ I) I. b& c8 s* q9 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)8 L% o% A: E8 W3 ~3 ?
a) provide an error message if the files are not found or there is a problem opening them+ q8 u+ i% G5 S. x0 F
b) compare each line of code
* o j+ }1 {3 K6 e& V6 v' y) r! [+ Zc) print out the lines that are the same6 A4 b& q3 D4 b1 H
d) count the number of lines compared / lines the same
3 E. s. i5 [ t) \The AuthorisedUsers class: (Total maximum 20 marks available); i) b# O3 V3 e6 ^' F) b G! d
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)% i [1 j+ O" \0 z, p1 g
4. Provide methods to:
4 {) }6 A1 y/ z4 Aa) 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# T( s' }% U+ Y) W
b) return the name of the authorised user% O4 U9 P* z, Z( {5 M
c) return the name of the department of the authorised user+ N9 U* W W# p: a: \
Individual Data (Maximum 20 marks available) e7 `, z8 y( {$ X2 V: I! c5 Q" u
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 \- Q( ^+ e. n8 v. rDocumentation (Maximum 10 marks available)
, X" L9 x8 X4 i3 z6. 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." ?- U2 I9 ~9 d n1 w
BSA104 Business Programming – 2007: Assignment 2
+ M; F* c( P9 z) b% ^- [4 GPage 3 of 5 |
|