|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
1 {& u) o* {) m2 H0 |- ?. L4 bShanghai - 20075 N' v: E% G! }6 y- ?8 a6 N
Assignment 27 X1 o1 S) q' m& 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), m" C! s- p: X+ y+ P# D& l
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.
; T6 m) ]" L3 L5 [( z; G- VThe staff must be able to:, M* n+ T7 Q9 T% i0 _8 x8 y& }
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.( p* f$ l; n; C+ [$ R0 A
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.9 L0 b7 X$ I1 Q; Z
 The interface should provide a menu so that the staff can:
7 _3 S, W" W2 Y1 {: {! m" M% va) Enter the names of the two Java program files to be compared
5 R5 ~1 t" A% u8 e Y For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
5 K( X: C) g) `' Q** 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).
$ t+ B& v5 q1 r2 ^( DBSA104 Business Programming – 2007: Assignment 2, _/ v( P' k7 G1 x/ Y
Page 2 of 5) h0 i+ @6 O6 p# n
b) Print out to the screen all the lines of code that are the same
- c* x" m4 H4 d* o8 N, L Include the name of the file and the line number of the code being printed for each of the two files
0 U6 U, Q, g" ~2 i' Uc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared4 n! S+ l$ L' N& m( x; w
 the name, username and department of the user4 b# T# E1 b) E3 I
 the statistics of the comparison
8 ?, l9 K9 }8 S0 c' h- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
$ s% t& d/ f1 P! Y8 m8 L9 D the recommendation for further checking8 n+ I* Z6 z! K7 P' x6 z* H% x1 o% |
- 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
( s+ i. r$ ~0 t6 |0 O7 u: O the names of the two files compared
! n3 T- x% ]* L# W# b h1 md) Leave the program (exit)! q' @/ |) w0 x4 W& R1 W
The ProgramCompare class: (Total maximum 20 marks available); G8 w! A) W" g- E8 s, Z6 k4 u
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)
" P: u4 q" k1 ?" sa) provide an error message if the files are not found or there is a problem opening them
2 j2 G% b2 g6 @( n$ U; a" Pb) compare each line of code" Q- B) u. k- {6 Y3 h
c) print out the lines that are the same% V. X+ u5 Z. M( w4 {9 Q0 M
d) count the number of lines compared / lines the same
$ P2 s; g+ I2 O2 EThe AuthorisedUsers class: (Total maximum 20 marks available)" R+ a: D( V4 T' V
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)( H/ M! G! @; j, ?% U$ \
4. Provide methods to:
q" g3 G" v( T: A7 |% w2 `7 ?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; W0 G' W/ S/ a. ^1 m1 ?5 |' G
b) return the name of the authorised user' n; `2 q5 @0 }: |4 d: {& J1 N
c) return the name of the department of the authorised user
% Y; V, [0 @4 U$ j( aIndividual Data (Maximum 20 marks available)
5 j, Z% k. j! z7 K n5. 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.5 v: ?: Q' M& V+ S3 k8 l6 Y- y: d+ W
Documentation (Maximum 10 marks available)- Y1 b e. D$ l2 h p; E
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.& a" v6 k' M; m, ?* k- A& k c) L7 z
BSA104 Business Programming – 2007: Assignment 2
& i3 N, b. Q5 GPage 3 of 5 |
|