|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
* ^' O- L. K# x- a& Y+ FShanghai - 2007
; D# L* c9 i& {/ X8 \0 PAssignment 22 X0 L0 F( T5 i1 i* _- N: y3 X- b
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)7 q% ^5 i/ X/ 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.
4 I" C4 Y0 x+ \5 B, _9 AThe staff must be able to:; k3 j4 x% ~4 R/ S/ z
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
( {2 G- Z/ O! z: _+ V; X* [. r1 x4 ?8 B3 [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.: n9 A( O# p M+ R
 The interface should provide a menu so that the staff can:5 R: Z" d: Z4 {5 t! z
a) Enter the names of the two Java program files to be compared
3 u# m/ M, G0 Y6 K7 N$ S z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.$ {, j0 \" ` F1 m6 |% 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).
& ]) _9 J( G: QBSA104 Business Programming – 2007: Assignment 2
( t2 U" ?% }& I0 C( u9 CPage 2 of 5
; B( t% f9 r8 O, |- ?0 }! Nb) Print out to the screen all the lines of code that are the same9 ^& `* V$ x4 D$ w6 s! r" I( B
 Include the name of the file and the line number of the code being printed for each of the two files3 p" ] C, b' c
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared* |5 I0 ]0 ^4 x
 the name, username and department of the user
. S/ w, U; |" ?, F, b4 R4 C, h% j2 L the statistics of the comparison
! h- ~$ @/ y$ C1 a- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
' f3 J' {. g+ T F0 r+ T: Y: _ the recommendation for further checking1 S- {" v$ P7 g+ W7 g
- 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% ?& w8 w1 F( }
 the names of the two files compared# s' P6 r3 q0 A$ H/ Q1 P1 J2 L2 ]
d) Leave the program (exit)0 ^: x9 z4 V d& p9 Q$ e
The ProgramCompare class: (Total maximum 20 marks available)
. s' M/ Q1 D: p; x# t! W2. 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)
' S6 M& i! K! k# p" M! n7 d g& ja) provide an error message if the files are not found or there is a problem opening them
- O( i% s$ \3 {# F db) compare each line of code1 v7 e) F4 X$ u6 c% H1 Y: X ^4 M
c) print out the lines that are the same( F" @# z3 O$ E. ?: k2 v
d) count the number of lines compared / lines the same
, Q2 l) V4 |2 l" wThe AuthorisedUsers class: (Total maximum 20 marks available)
2 u4 W7 A( z2 N- |4 k/ C4 y3. 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)6 p, v5 V# d7 b8 j3 y( z) x( ^' K; E
4. Provide methods to:. m& d2 M# a3 A" A0 Y# d9 L8 C
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 match5 ?- Y5 V4 i) h% `# |
b) return the name of the authorised user9 m9 Q$ u; T8 s1 u( f( X1 ?5 E
c) return the name of the department of the authorised user7 U+ b0 C2 ^* [0 K% o+ J
Individual Data (Maximum 20 marks available)
' h& O0 M9 x& u" a4 X. B5. 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( x8 e. I( \6 E9 v% mDocumentation (Maximum 10 marks available)
% y9 r( E! u" }$ a X, H/ c6. 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.' W, g4 H& V6 m) l! E; _$ S9 T
BSA104 Business Programming – 2007: Assignment 22 U! N2 f% f9 D- q$ Y+ o4 a8 t( `
Page 3 of 5 |
|