|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming6 f& |7 c& V* D
Shanghai - 2007
- E# a* j1 [7 s4 A; eAssignment 2' J/ r5 ~, ]) W& E. S& j
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)( \' N& D1 S* j# O0 N7 b& p9 n9 _7 ~
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.# Z) z& B3 C) w( Q( P
The staff must be able to:
; @3 g. {8 d$ A( b" M4 d3 o Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
, h& X1 t, Q- D1. 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.
' Y. I/ Z. t4 r% o The interface should provide a menu so that the staff can:0 |/ r7 u( [. }( }: X! g Y3 U
a) Enter the names of the two Java program files to be compared8 }) f! }5 |+ U% v
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.- {4 o5 l# j3 p+ q" Y' q/ L
** 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).
9 `; _% p6 @- Q! ?BSA104 Business Programming – 2007: Assignment 2
, i9 e$ F6 Q! o% y APage 2 of 5+ T% Y. S8 L! a7 z- g! a5 w# R! ~
b) Print out to the screen all the lines of code that are the same$ r, z& m' e" h/ H. z5 s/ I
 Include the name of the file and the line number of the code being printed for each of the two files- U6 H$ X- l0 C7 U) Q2 p
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
* R1 r& e8 Z! |/ N/ v the name, username and department of the user
2 g; P+ U3 h6 a+ w" _8 W8 o9 T the statistics of the comparison# z: Z* e2 K( G: E7 E
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different9 k |6 U4 D( d6 L8 B; j
 the recommendation for further checking
! t7 r$ S8 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
: o H- J3 z/ D& p' E the names of the two files compared+ z/ d% K6 n# u G$ N5 w" I$ E& \
d) Leave the program (exit)
5 }5 A$ I% S! X; zThe ProgramCompare class: (Total maximum 20 marks available)7 u+ O0 q. C; k Q- p) t+ |
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)
5 n7 L+ M* z, k$ F1 ?a) provide an error message if the files are not found or there is a problem opening them; Q* t6 b2 L4 |7 T9 M
b) compare each line of code
; K% {* x, T0 o% p, Dc) print out the lines that are the same
$ l+ D) N& o' U2 id) count the number of lines compared / lines the same
1 S) ?& K* ^# p, o, C' R6 LThe AuthorisedUsers class: (Total maximum 20 marks available)
+ G m. v& b% f. J" n3. 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)( E. g3 X( m a4 k+ h
4. Provide methods to:; F" D/ b2 C- `$ R. Y) `
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
3 q' ]* [" k+ X/ `, Lb) return the name of the authorised user
: X- j: F$ q0 ^1 H; {/ ^c) return the name of the department of the authorised user
+ V x/ D0 {, v+ h) n" R& R4 NIndividual Data (Maximum 20 marks available)8 S% @: F% Z; K+ _" k5 c1 R1 i p! M
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.- T8 M0 C* l. n$ q. Z2 A+ {: \2 z, d
Documentation (Maximum 10 marks available)$ b5 f% c! g G9 k4 p0 }, _: M7 T' d
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.
! H& [* A3 \% x& H6 j% R- MBSA104 Business Programming – 2007: Assignment 2, G6 w3 ^: L2 l( n8 P
Page 3 of 5 |
|