|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: z, b8 W" B8 k3 @9 k' u4 C# M
Shanghai - 2007- V7 J' Q$ }7 N8 p$ R
Assignment 2
^1 f0 V- R, M) r5 UDeadline 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)
0 i, X5 w5 m) n$ b- b+ E1. 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.7 U# i% A! J+ E+ [
The staff must be able to:
& X; O, B8 q9 x3 k4 u8 ]. A6 Z; O) [ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
+ l0 ?8 K+ G9 i1. 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.: A) t4 T5 u, b8 P- e: E
 The interface should provide a menu so that the staff can:5 F; ]4 O: J2 C: G! d
a) Enter the names of the two Java program files to be compared
3 b0 W( }3 y- g; c For this assignment, it will be assumed that the two Java program files are in the same folder as your program., V$ k! U. H1 h) t; h6 b3 s
** 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).
. q% o: J& K! a& BBSA104 Business Programming – 2007: Assignment 2
% A% p9 A# ^4 uPage 2 of 5
' l2 Z0 M# w2 A7 P$ R# Nb) Print out to the screen all the lines of code that are the same
' z% B( U: v) t Include the name of the file and the line number of the code being printed for each of the two files, B/ i0 p) ^0 E" o; H8 F
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 @4 ~" b7 E* |( a# i% P. E the name, username and department of the user
3 x& B" W* h) q9 P3 l: c+ s' Y W+ c the statistics of the comparison3 g0 Z( X3 f# L$ s0 U G: P
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ Z7 T! @, H& f* _8 q, r# ]+ W: w
 the recommendation for further checking& }, O3 n' N0 t0 c: f, 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! Q! A7 K' x( t
 the names of the two files compared
% }% {( e' k& sd) Leave the program (exit)
* ?' K6 s* c' z. H( q# [3 b0 I7 b# `The ProgramCompare class: (Total maximum 20 marks available)
1 g& A% Q9 a0 @& u4 Q2 a$ j; ~( e& |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)" ?; n! F- C' G5 B
a) provide an error message if the files are not found or there is a problem opening them
# ~4 ]0 ]3 d+ z* \4 J5 j' A. gb) compare each line of code% d/ Q/ h9 B9 y# E2 s+ I
c) print out the lines that are the same
/ X9 y5 A: M6 A$ _( {6 ]. md) count the number of lines compared / lines the same
. f7 Q$ [3 M2 [* ?The AuthorisedUsers class: (Total maximum 20 marks available)
1 z0 r$ ?9 Z( D$ e0 l3. 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)
0 A D. e) D- s J1 \, S$ @7 a4. Provide methods to:
1 N9 a9 G* `4 j3 ?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
: W: U! r# [7 f* U# w$ g9 m9 ]b) return the name of the authorised user9 v, Q/ y% s% X& d) s6 y. Y
c) return the name of the department of the authorised user
, F% V6 x/ j% {( p! j# H) }Individual Data (Maximum 20 marks available)9 d# |2 Z# ^+ r! C
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.
% ~. h0 \. z: q: V( JDocumentation (Maximum 10 marks available)
1 ^& u3 |% y2 o1 {& ?& u$ y6. 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.. f, Z0 D& O% f% x# l
BSA104 Business Programming – 2007: Assignment 2
. _; U) T* R9 U9 z/ [) c, }Page 3 of 5 |
|