|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming/ c7 V6 J( m# m3 t. b) {6 W
Shanghai - 2007% {, g& U- i' t. b
Assignment 2; X( m% X2 W0 X" H4 z* M7 l6 \
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)0 f& k# p, U3 h1 ], y$ K: S+ Y1 Y& }0 W
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., ~) M. [5 y! D
The staff must be able to:
$ i+ [4 j+ M* ^# `. y$ [ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **./ W. R6 P3 V# c/ m- L0 t6 w. t/ \6 n
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.% E1 H# w+ z: K2 @& T# X
 The interface should provide a menu so that the staff can:% U6 W" q) r6 u1 e, l9 l
a) Enter the names of the two Java program files to be compared" r4 Q Y& y$ q+ ^9 r& N
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( \1 z: y& N( E
** 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).
" F0 C# w. b6 c6 K! m- hBSA104 Business Programming – 2007: Assignment 2( g$ m2 c9 D( Z1 Z+ [
Page 2 of 5. t ^# x7 M4 p3 L
b) Print out to the screen all the lines of code that are the same
4 h# G3 Q, b. p! O Include the name of the file and the line number of the code being printed for each of the two files
$ S d Z) O. Pc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared6 z4 l: E( U( m. p
 the name, username and department of the user
( `0 ]5 m0 X# d% l- x. i; t$ t0 | the statistics of the comparison
8 I( f0 t C2 w- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
& D; K- \9 H/ C. I the recommendation for further checking& V8 z& \) }* Y! w
- 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
: E4 q) [" r0 ] the names of the two files compared z: q- N( b+ [. P% N9 q! \5 d
d) Leave the program (exit)3 F. F3 f4 f: U+ h6 ~( x
The ProgramCompare class: (Total maximum 20 marks available)
. C2 \% m4 E2 n- e8 C2. 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 ^. m9 @, G% L: y e" h6 ?! za) provide an error message if the files are not found or there is a problem opening them, o: \, P+ H+ }5 x
b) compare each line of code
0 w, P: m; \4 R9 ~& [# Mc) print out the lines that are the same
J0 V- ^6 S; qd) count the number of lines compared / lines the same$ A9 J+ e" o) W9 j d5 P6 U5 m% u
The AuthorisedUsers class: (Total maximum 20 marks available)
- c' Y& M8 K% I3 E& e* W3. 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) o2 O7 Q, B! x8 m! F8 h& l% L
4. Provide methods to:
' n/ m8 H% F6 \$ [8 {, b0 e! ]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& z* u& E: j' n+ L
b) return the name of the authorised user$ A2 B& P' t0 d4 j3 n9 ^! b
c) return the name of the department of the authorised user4 N6 R# e5 Z1 g* z' G( i9 ?
Individual Data (Maximum 20 marks available)
* A4 r7 ^8 J# Z! g5. 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./ `: w6 h f `& w% g( q
Documentation (Maximum 10 marks available)
' Y0 Y& v4 o6 z3 `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.
: I8 N& n$ b9 \2 t% d/ Y$ c- j) s r# BBSA104 Business Programming – 2007: Assignment 2! s2 \, @9 Y4 q: g* z2 |
Page 3 of 5 |
|