|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# o9 v1 w$ B. s* q9 }4 g% QShanghai - 2007
; c( w1 O. [/ A9 n0 j, FAssignment 2
6 b! k/ i; E8 }8 [/ B4 O* oDeadline 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)$ X, z+ T% v0 K0 C& h
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.
& r. D z' I2 i, `The staff must be able to:0 _! K, S0 i1 v1 S
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
& X8 ~+ P" U- ~+ |# h( I1. 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.9 X6 v3 S2 \# p5 R1 f8 B
 The interface should provide a menu so that the staff can:
+ G7 e7 o6 f: N4 h. Aa) Enter the names of the two Java program files to be compared
3 v! u, A1 `1 j: C: ~+ a For this assignment, it will be assumed that the two Java program files are in the same folder as your program.- ], f- e o/ D
** 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).
, }3 K! U2 @. B q* I! p( CBSA104 Business Programming – 2007: Assignment 2
' Y( {& q( c' M# ]$ ]+ P# t+ z# OPage 2 of 5! m# p# ~1 C' w8 m( n7 B6 X
b) Print out to the screen all the lines of code that are the same% J2 K9 _# k+ _6 w7 X7 T! p6 J' Y
 Include the name of the file and the line number of the code being printed for each of the two files
/ C3 {: _$ r) x# W$ L$ Ac) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared2 H. J9 M# y. Y B* ?4 m! `+ ]
 the name, username and department of the user- R' L( v) l- S: o$ z: Y3 A4 a
 the statistics of the comparison
' L3 U! a2 W1 c) _7 v- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different$ w {% E5 i- Q J5 k. K0 g3 q, M
 the recommendation for further checking
4 W; F+ K, ]* T# w; I* T- 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- e5 X6 R& Q# }4 D! h N* N. ~
 the names of the two files compared5 Q* H$ Z* ?/ d
d) Leave the program (exit)
D; B1 {& [; H' @4 oThe ProgramCompare class: (Total maximum 20 marks available)7 s9 ?; G0 \4 F* g
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)
7 G& V/ J& \' z0 I% Qa) provide an error message if the files are not found or there is a problem opening them; D6 Y% C: C8 w' @$ g( ^
b) compare each line of code
' ~) _, ~. p5 {# Sc) print out the lines that are the same
; T+ r' o4 t# h2 g) b5 |6 [4 b3 f' Qd) count the number of lines compared / lines the same% Q; _# P9 P, i' h+ e: Y( k
The AuthorisedUsers class: (Total maximum 20 marks available)
3 c" ^. w$ d( i2 F# W; c: _) m+ @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)1 Q6 K5 ^- {) K7 X3 `
4. Provide methods to:
0 K7 I6 i7 H5 I1 K, U1 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 match
5 V9 M) b6 D5 Lb) return the name of the authorised user9 r$ [5 r S, D1 l( W5 A9 V$ y
c) return the name of the department of the authorised user
, \' K1 h3 d4 Z8 V6 J' yIndividual Data (Maximum 20 marks available)0 Q. \' F6 i; y
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.
/ H/ V9 r6 d% D3 W2 f* K( IDocumentation (Maximum 10 marks available)0 p6 T# b3 I, k9 k1 u! N. Q
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.) x: W, t$ z+ b7 i* Y5 i7 e/ v
BSA104 Business Programming – 2007: Assignment 2; G3 `5 n) E& X( I% b, Q
Page 3 of 5 |
|