|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
: K% Q$ t% ^7 M) E4 VShanghai - 2007
: D+ ~1 q+ R' I8 OAssignment 2
' y* }/ Q% _* B$ q4 ~7 @, ~2 fDeadline 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)
' L9 A6 Q$ [, v$ V1 t# ?: ?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.
) T! y. v" @& A$ `% HThe staff must be able to:
1 C* S, E6 ^" D4 O2 p' P& d Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
9 y$ \6 L% l* B5 p- v4 W4 x1. 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.8 S" A+ J! P" P8 p& D' T
 The interface should provide a menu so that the staff can:
6 o3 ]$ J- a( b0 M1 oa) Enter the names of the two Java program files to be compared. o, y5 D) w5 c: }
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
; p! w' w4 _! v2 d2 c; O** 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).- G5 j9 e% f2 v' t* l y
BSA104 Business Programming – 2007: Assignment 25 W/ G. ^1 j5 K% }
Page 2 of 5- i; O. N7 C _% ^$ h
b) Print out to the screen all the lines of code that are the same
8 v1 V# t2 Y6 w4 i Include the name of the file and the line number of the code being printed for each of the two files% L* O+ e9 ^- V- N' d
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 ?0 x) j) }5 R0 R the name, username and department of the user
+ z `4 g! f3 \4 a- _ s the statistics of the comparison; G t9 b6 }5 N) q& M2 E S
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different f/ Q6 y4 Z/ y5 S8 B; d
 the recommendation for further checking7 E% k0 T5 ?, X1 K6 s( s- 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
! X# x( I" ]! l$ P1 X, [1 u the names of the two files compared+ U: V/ S- ]0 V) \; }
d) Leave the program (exit)
5 s I6 s# W& f6 AThe ProgramCompare class: (Total maximum 20 marks available): M" Z' Y* z$ \! M4 p3 {" F5 v. t
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)- Q( H& C: C5 o& K. o. D
a) provide an error message if the files are not found or there is a problem opening them
3 S8 Z" [" U7 S* yb) compare each line of code
2 h+ X! i- ^# Ec) print out the lines that are the same
0 b" R2 u& ?& r; g v: a) u8 Sd) count the number of lines compared / lines the same
7 v- E, V$ \$ H3 z0 pThe AuthorisedUsers class: (Total maximum 20 marks available)4 U& t! W; c3 b& N. p$ }! U2 o
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)& y" [9 w) w( I5 F; D
4. Provide methods to:
) e) s& g4 Q2 |. pa) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match9 }3 S6 v7 X; ^9 D2 ~
b) return the name of the authorised user
0 U" i$ B2 P1 s- k% Z1 bc) return the name of the department of the authorised user1 S" ]9 {% _3 u- S# B9 }# i! v
Individual Data (Maximum 20 marks available)
$ z- L; B- a( y5. 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.
# s6 z, D$ G/ {3 m4 p; PDocumentation (Maximum 10 marks available)
1 }' }% N/ m/ C6 z) Z% L9 _' w* 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.
# f9 T- P8 d! a( Y) @6 eBSA104 Business Programming – 2007: Assignment 2! j B K; L1 C
Page 3 of 5 |
|