|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming, k) A" H+ G4 s. y! I
Shanghai - 2007
4 i4 A1 O5 z6 GAssignment 2! N& |2 |- u; L* M
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)
& ?/ @: p) g) G* h% U: f: i1. 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.
% Q/ x6 H+ b0 S# RThe staff must be able to:: G7 `! i: ]2 q3 Z% q% a
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
/ Z8 s' R$ I7 S) W) J1. 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.3 l3 J1 g3 i( W8 |" j
 The interface should provide a menu so that the staff can:
P1 T; W! R0 H7 O# x# `& \( O+ Ya) Enter the names of the two Java program files to be compared
! e" m8 f' J! h6 A" r' B For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
R/ S5 _% N& z9 ]" @** 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).
^( Z% E3 i, \ I3 C6 iBSA104 Business Programming – 2007: Assignment 2- ] C( Y ?& R" @# ^. J
Page 2 of 5
2 U' ~6 S, C+ Z E( w3 Kb) Print out to the screen all the lines of code that are the same
. ^6 B* a# \) k. l- [2 P Include the name of the file and the line number of the code being printed for each of the two files
2 y& v) b& Z" ?; m/ ^* E9 ?# A0 Jc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared& A% v! L" F; J% C6 d v! S
 the name, username and department of the user
5 n8 ~6 T0 z. a7 ?3 D$ j the statistics of the comparison& s! O- x, s c# E' F2 Q
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: J7 Z4 W8 D! J$ k
 the recommendation for further checking
6 g8 u: Y2 p: l* P0 N- V2 j) X- 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
% T4 e0 W5 L8 s, q the names of the two files compared: i! L4 R& U7 M& `+ j7 E0 N
d) Leave the program (exit)
c% g/ O9 V6 G' L% OThe ProgramCompare class: (Total maximum 20 marks available)" r+ o* `" J1 p1 b, K
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)! k m! I& `/ ]2 e% p( \
a) provide an error message if the files are not found or there is a problem opening them
& S& V: N" m/ ab) compare each line of code' Y) T/ [) }* D6 E W9 ~4 e
c) print out the lines that are the same
: u3 j1 z2 y$ G5 d5 [6 M$ ed) count the number of lines compared / lines the same a2 I) A, F4 q+ c& G8 N
The AuthorisedUsers class: (Total maximum 20 marks available)' l4 G, n8 A& a$ V0 e; G; X- P( X
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)% t: o2 l1 B4 u4 ` [' x ]( i
4. Provide methods to:
+ d) p) O0 M( W/ a }7 w# A& ka) 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
1 Y( `6 M$ K2 Q1 wb) return the name of the authorised user9 g3 J# n) k' ]; e9 r
c) return the name of the department of the authorised user1 m) L- T( L" Y% P1 O
Individual Data (Maximum 20 marks available)
% v/ C* }3 N0 q$ o5. 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.3 q+ ~: A5 K2 n6 Y# S' a& ]* g4 S- l
Documentation (Maximum 10 marks available)
' f& r1 W% U$ z6. 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.
/ T4 X6 @8 h4 }" Y: p3 hBSA104 Business Programming – 2007: Assignment 21 L7 z6 X3 J2 f; O a. k5 h4 p5 S
Page 3 of 5 |
|