|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
! I9 z5 Z! Z* F4 p1 Y$ yShanghai - 20076 ]8 k, l' ?6 o/ E
Assignment 28 t( [. j1 f8 b1 t. X6 Q4 i7 ?% Z
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)+ A. |+ H S. _1 G) J
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.
- I- W2 Q2 m1 f5 Z0 uThe staff must be able to:- I1 Y* A& N( l0 a$ c- s% P0 L" P
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
4 M! L' n. V' e A1. 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. Q: J9 V3 N5 y/ E- X
 The interface should provide a menu so that the staff can:
( l! \1 p0 G6 x9 I% v7 n1 }4 Qa) Enter the names of the two Java program files to be compared# q, ]' o1 _/ s i
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.7 ~; B9 H5 Y% d# t$ L3 ?- |8 G
** 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).
9 C1 X& H2 `+ {! v7 s. U- T. tBSA104 Business Programming – 2007: Assignment 2
* V; |/ E* g2 z. c6 u- {: k: YPage 2 of 5* A# |9 i7 o; i$ c- v# @$ s
b) Print out to the screen all the lines of code that are the same
7 C) h4 K0 t% a8 y Include the name of the file and the line number of the code being printed for each of the two files6 h x1 c& T/ Y8 Y
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 p- @4 e3 v& b/ J4 c
 the name, username and department of the user$ z/ _+ ?' E% h- g1 _
 the statistics of the comparison
' N6 C6 ?4 K1 k, m2 D- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
" b. _) _ T! n1 ^4 M4 B, S$ B+ C the recommendation for further checking
% s% U* @# H# B- 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
0 Z6 } n# @# \. ^ the names of the two files compared
1 n5 T4 W$ D @ F0 \" xd) Leave the program (exit)+ N% x- \$ ^: ], s3 R5 K
The ProgramCompare class: (Total maximum 20 marks available)" Z6 Y* k. G+ x5 |7 L1 M
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)- r* [/ }, t+ K- F# A
a) provide an error message if the files are not found or there is a problem opening them# J v# ~* N8 z" G; J3 J
b) compare each line of code
$ A$ K F. L2 x* r0 V) O/ gc) print out the lines that are the same
3 l$ }4 k. i& N* yd) count the number of lines compared / lines the same) X& ^, B( M+ H% U8 M
The AuthorisedUsers class: (Total maximum 20 marks available)0 m6 R- J) B: S% D
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)
' X/ ? ^% e5 r9 I9 m4. Provide methods to:
; U6 s& `, H0 U ] Sa) 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
# d& U5 H0 Q) O/ I0 l x" Wb) return the name of the authorised user
5 Q4 h/ `9 S2 s/ y/ M( i4 X- Xc) return the name of the department of the authorised user3 m& ?; b4 F+ |6 X! y3 p5 z
Individual Data (Maximum 20 marks available)' R( s' Y/ K+ V9 K+ C3 H
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.
* K! y r) N' g% Z) u" t3 dDocumentation (Maximum 10 marks available)
( ~7 n* T3 A0 i J; w' u6. 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./ E$ c* b; u. S9 _ o' l1 g
BSA104 Business Programming – 2007: Assignment 2
; s$ z1 w% ?( B- H3 j# _Page 3 of 5 |
|