|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
0 ~# x* a8 U* h, A& W1 B6 g4 aShanghai - 2007) n3 Z+ A( T: M, o' B2 @
Assignment 2
4 y) ^+ @5 N8 G# [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)
( e/ ~) Y4 }( G8 R' t. P1. 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.
9 W/ T4 G9 I* Q% ^$ uThe staff must be able to:
0 m, p( H+ f7 ~1 x2 q* q Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
( \7 E! `- J% \9 `% S5 m- q1. 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.7 d x# l* s: D3 }! A
 The interface should provide a menu so that the staff can:
9 E% w! `8 S, O5 B7 X) s7 ja) Enter the names of the two Java program files to be compared1 S- q7 j! @+ D
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
- ]' y w' a% j r% B** 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).
6 G9 i8 o7 y3 E4 ~; i7 o p& x/ g0 n8 `BSA104 Business Programming – 2007: Assignment 2
8 b) q O" Q5 n& q% y; v! VPage 2 of 5
{4 s4 p8 c1 ~b) Print out to the screen all the lines of code that are the same
5 f+ T- P8 v7 L- j Include the name of the file and the line number of the code being printed for each of the two files- U8 N" z0 z* i% o
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared1 u: G6 G& @: D* [2 k
 the name, username and department of the user
% R) H- p2 d5 q0 a' A& B the statistics of the comparison5 ^7 Q! `. ~" }1 H$ J- n
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
4 x9 f) y3 Y' R3 d) a the recommendation for further checking
7 h5 Z, D3 g$ g" I7 i3 c- 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/ n' _* p6 C8 }2 w% A5 @! F1 a
 the names of the two files compared+ K8 A/ ~% c0 e* \# k( z y
d) Leave the program (exit)) D7 V3 F+ \2 q6 Y
The ProgramCompare class: (Total maximum 20 marks available)
. _. f# X0 ]! j4 X8 F8 H2. 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)
& f: r. m6 R' X Q2 i4 L2 j5 J- Aa) provide an error message if the files are not found or there is a problem opening them5 e2 V7 K* j _( F
b) compare each line of code: x5 O% O/ y# {* G
c) print out the lines that are the same
* F$ |5 \4 [ f/ c( {d) count the number of lines compared / lines the same! f( ^. G0 [. T0 e
The AuthorisedUsers class: (Total maximum 20 marks available)0 v6 Q0 U7 K/ j; X9 Q
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)- Z7 B* u4 z$ h! r
4. Provide methods to:3 @: n# |4 i2 K/ y4 o
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
/ I- Z6 y- |5 C. i" Db) return the name of the authorised user" E, _8 C0 j+ y& N8 D( G H
c) return the name of the department of the authorised user
2 `7 L3 }6 q; N1 }Individual Data (Maximum 20 marks available)3 G4 C* ^- l5 j: ^
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.5 Y6 t. ?. s, ]
Documentation (Maximum 10 marks available)
3 y1 S/ y# t# o+ a. x6. 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.
2 O( Z8 n* s \6 R2 S4 Y. JBSA104 Business Programming – 2007: Assignment 2+ [- ^9 |" V5 \ B2 a+ y5 |
Page 3 of 5 |
|