|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 F- {6 g6 v# `& p
Shanghai - 20079 y$ \9 h& X' O! \
Assignment 2
2 j0 ~# e; `/ V% R( j8 b! i3 VDeadline 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)5 a8 c& a3 Z/ X+ I8 t% |8 x
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.
! ^# b2 g4 ^$ z' \$ ^The staff must be able to:# v: Y" i& P3 v% h
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! l* I* p. M" @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.
- l. s! E7 J0 N+ j1 w# U. ` The interface should provide a menu so that the staff can:8 }9 K5 A; I I |. l
a) Enter the names of the two Java program files to be compared
: Q7 i3 [5 A; _( p9 S5 L3 X For this assignment, it will be assumed that the two Java program files are in the same folder as your program.& k2 g7 |7 S8 x' w9 }5 L2 d
** 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).& {5 b O7 L/ E3 y0 d7 R
BSA104 Business Programming – 2007: Assignment 2
! J4 E- ^1 I3 ^/ w4 oPage 2 of 5' i! U2 g9 L3 a2 A1 w1 p
b) Print out to the screen all the lines of code that are the same
% n6 T+ r* @( G' X4 P3 i5 u Include the name of the file and the line number of the code being printed for each of the two files) T: h- ?9 ?1 Y- N
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared, T9 p! @7 C/ P
 the name, username and department of the user+ Z* c" u) K: @- q( x' B
 the statistics of the comparison6 R" b8 ]2 I9 ]2 g- U
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ x* R9 V2 y; p- D7 r) X) J
 the recommendation for further checking
2 ?# X9 f `7 o6 S5 F) 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 closely1 Y6 R1 K, ^& p
 the names of the two files compared# q$ d# q( W' m* D
d) Leave the program (exit)
/ s8 C$ G" y3 d6 V# Z/ pThe ProgramCompare class: (Total maximum 20 marks available)6 R; Q8 e' p1 N/ W5 q
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)0 J( Y3 A3 [7 J
a) provide an error message if the files are not found or there is a problem opening them
% m! z9 y# {: \$ Jb) compare each line of code
! H/ N/ |' T* h; s( Ec) print out the lines that are the same
' q" y5 R/ T3 L# F8 ^) M' @2 }3 dd) count the number of lines compared / lines the same
1 M8 J6 P. `2 E5 ]( n; \" y9 UThe AuthorisedUsers class: (Total maximum 20 marks available)
8 m2 g9 J; t9 k& R& g0 A3. 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)/ V9 n+ G, ] ~, ^0 N3 h U4 b
4. Provide methods to:
+ m' t' z- z. x S' \* S% @- sa) 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
' @$ a/ ~2 F( S% }b) return the name of the authorised user
' i/ i7 o; v8 x) bc) return the name of the department of the authorised user
5 U: g, K! p6 `, Q( O- gIndividual Data (Maximum 20 marks available)$ s6 Q7 Z; Z3 q) F. v( { ?3 |; 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.
$ |2 o. \+ O5 Y- Z; G2 W& \* cDocumentation (Maximum 10 marks available)
! ^3 M9 ]; u! @2 v- |: a6. 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.: [- ?( x' C; j2 L5 r5 C( I9 O
BSA104 Business Programming – 2007: Assignment 29 V2 J1 a9 n$ }; G' I9 b
Page 3 of 5 |
|