|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 R- j) [9 ?. ?# g6 N$ A& |Shanghai - 2007
! ]3 h) q9 C' E1 TAssignment 2$ t" U1 Y* I4 D5 \
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)
# M8 o: S$ m. m% u, H: L: l! P, A1. 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.
% t4 H8 _- g4 e9 G0 ^% YThe staff must be able to:* W( Q2 o8 {. V+ s! a1 R
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
3 B1 P7 Q- ~9 c$ ?% I) g, L# E! H1. 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+ n0 l3 j( ~4 [2 @. n7 H The interface should provide a menu so that the staff can:6 s0 P7 B2 T0 T1 n1 z# M; o; B; W
a) Enter the names of the two Java program files to be compared8 O* |# P1 f, [+ J2 r2 e: o
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; O* {6 }& _3 ~) ~** 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).$ I. i6 \1 W7 G9 n! b; F
BSA104 Business Programming – 2007: Assignment 21 G% l+ F, o' o3 Y
Page 2 of 5
) K7 F7 ]! x6 J3 V6 Lb) Print out to the screen all the lines of code that are the same
6 ~& R& Y2 d( J0 F5 u5 p3 u" k Include the name of the file and the line number of the code being printed for each of the two files
, N$ U- E7 D! e/ }! Y( Y, d3 ec) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
5 N! E4 K2 M2 y4 \( \0 c the name, username and department of the user
7 b" f! z# Z- t. [* L the statistics of the comparison
! S# l# B9 ^) n- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' u0 T) J4 K7 F+ p$ n the recommendation for further checking& ]6 C' C" X) m3 @+ y4 E* P
- 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 closely7 H5 f4 N, S9 P! D7 W
 the names of the two files compared) V. T! A9 C) _2 `9 m5 B& L! {
d) Leave the program (exit)$ z, i* y( @9 d/ D4 q+ k3 }
The ProgramCompare class: (Total maximum 20 marks available)6 x! L7 y" e4 z; i
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)4 E% |& [) s$ O
a) provide an error message if the files are not found or there is a problem opening them2 R2 V6 e- U" X2 q
b) compare each line of code G! Y3 @/ i2 E8 D* p. n, O
c) print out the lines that are the same( i* r% \$ t: \1 b) ]" s$ Z
d) count the number of lines compared / lines the same
4 W/ S& {: x$ U) B. oThe AuthorisedUsers class: (Total maximum 20 marks available)
7 w8 l$ X7 ~, x: 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), ?( I7 X, z3 `$ F+ T8 `. l8 ?. {
4. Provide methods to:
) H/ h* v6 ~; F- B# E# la) 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
, z2 E8 [% i5 f# L$ r" gb) return the name of the authorised user
/ o* s& q: j. G( j! Lc) return the name of the department of the authorised user
% s2 f9 U& {. x* u& M" t0 cIndividual Data (Maximum 20 marks available)0 a" e5 s* c6 F! U2 B
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.
( d! u2 j2 j9 } D; x, cDocumentation (Maximum 10 marks available)
/ m; q) X. X+ A9 x3 O6. 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.
- L5 q% b7 {" E U6 |9 h7 eBSA104 Business Programming – 2007: Assignment 2
0 s' F7 ~& O8 U$ E0 jPage 3 of 5 |
|