|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming8 X1 [- M8 A k
Shanghai - 2007
6 D# \( G. J2 H GAssignment 2
/ g' t8 V8 ^+ H6 `4 lDeadline 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)! s5 \' r" L& C
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./ H& X+ L1 K8 V4 b, n) ?8 ~
The staff must be able to:3 e4 ]& w; C0 T6 [' c
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
/ Q, Y; r! T) ], V' {) l1. 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.' l: W0 p! D* ~" I' m
 The interface should provide a menu so that the staff can:
~( }9 M. D! ~, Y( ta) Enter the names of the two Java program files to be compared/ u/ |" z8 i S% S; I
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
- P |# r2 M& @4 a** 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)./ W. O- h, \! Z( P0 d4 X! [: s. Z
BSA104 Business Programming – 2007: Assignment 2) z5 t7 `& t6 a0 I2 ?; e/ {9 m
Page 2 of 5
5 P- @! X" Y |6 Ib) Print out to the screen all the lines of code that are the same
+ u- a- l5 }8 y% W- F! H9 y. H Include the name of the file and the line number of the code being printed for each of the two files
* k0 p3 x% G: L5 Ec) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared7 u" j7 _' ~" s# ?
 the name, username and department of the user
5 u; [* Z/ a0 S8 g# D5 J the statistics of the comparison
, x6 [. R1 [( z8 h6 [ Q% E% R+ z- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different7 D+ X5 z5 I# n& u7 C) ] {
 the recommendation for further checking/ Z F" l- n3 |' j) R5 e7 H# 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/ T0 U2 X0 R/ ?% x) B
 the names of the two files compared- B& k: D0 P# ?3 B
d) Leave the program (exit)
% m; I& O2 y7 b4 H, QThe ProgramCompare class: (Total maximum 20 marks available)9 f$ `, ?( }( Z$ B7 Q5 _
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)* G& W3 A0 V2 g% M" \
a) provide an error message if the files are not found or there is a problem opening them
- a$ Q/ K( ?, U R9 k/ qb) compare each line of code# I. J9 C0 p# U- H" h
c) print out the lines that are the same3 L( M% Q6 \& ~0 Y; u; C
d) count the number of lines compared / lines the same
' G0 J* }5 K$ vThe AuthorisedUsers class: (Total maximum 20 marks available)0 ~' O4 d% z' y' G7 i5 a
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)! N8 e' E* K+ c
4. Provide methods to:6 N1 B1 G; D+ H" W3 `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# Y# u& D! e9 Z$ g$ S/ ~3 |& m
b) return the name of the authorised user2 F% |% h& o" O1 Z
c) return the name of the department of the authorised user6 W- d1 \# `0 Z3 n- S
Individual Data (Maximum 20 marks available)
/ N1 i/ A) X( c5. 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.
# {6 J! h/ `0 {" NDocumentation (Maximum 10 marks available): E3 @1 \9 O9 w3 m2 ~
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.
/ D* I1 q: R& G5 M$ cBSA104 Business Programming – 2007: Assignment 2
7 f0 [$ |1 S5 G! E0 X3 gPage 3 of 5 |
|