|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
! e; o2 N% j( b9 d" s2 XShanghai - 2007
: [6 l6 x! q2 A, U3 QAssignment 29 K# N. o, V* M4 J& C7 f2 ~
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)/ n( W/ ]/ E' R5 f. `# G
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.
$ o# n! R3 {2 d" |& \! n' j( WThe staff must be able to:3 Z( o# x7 k$ y0 @+ n Y* v7 j
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
! C) u8 H' r9 \/ v1. 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." d2 _. }0 t0 |
 The interface should provide a menu so that the staff can:4 F6 K+ j- u! p1 J3 b( [
a) Enter the names of the two Java program files to be compared
2 j: r9 ?! v) i For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 u$ r& T# h) }/ G4 }% }% 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).( a/ v3 O: |+ I& y- o" e5 [
BSA104 Business Programming – 2007: Assignment 21 l& K* ]" ]2 B ~2 g
Page 2 of 5
. U! Y+ x) _4 F* m& `1 ^, eb) Print out to the screen all the lines of code that are the same
& z) {4 t! b2 P% {6 T Include the name of the file and the line number of the code being printed for each of the two files
4 I( R o3 R& M# [$ yc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
# G9 B( [/ U% h H1 N) ` the name, username and department of the user
$ W- S J3 O! W3 _4 Q6 b the statistics of the comparison
1 T' E! A, M0 |) [" P- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different" c( i# X. b: ?( I1 z( z
 the recommendation for further checking' R, {3 i9 O: d- u- t, F( n
- 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 m" l/ |3 X- S: p; O
 the names of the two files compared, @& z! t8 X7 }) h- j% K3 ~- P! `- k
d) Leave the program (exit)# E0 \% I* E- J3 p+ Q7 J. [
The ProgramCompare class: (Total maximum 20 marks available) x9 s) W! A: ]8 L* t3 }6 u( 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)
7 L( v3 U* v9 j8 d0 r( u- o: Ja) provide an error message if the files are not found or there is a problem opening them0 i5 y& O) x* O" G& W! o# \7 @( o
b) compare each line of code
1 d% _8 s' u( d7 d9 @c) print out the lines that are the same5 c1 ]4 \3 q; j0 g8 a! F6 N% x
d) count the number of lines compared / lines the same
+ e- A) D* e7 n1 iThe AuthorisedUsers class: (Total maximum 20 marks available)
2 ~0 {. e; }; H3 N( R4 }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)
2 p& C9 B( a* y4. Provide methods to:
6 u+ [1 K. p% ]* k8 c8 _" aa) 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+ r3 g6 }& O* k- L2 w8 rb) return the name of the authorised user/ p0 x8 F4 z3 q% e8 f# l4 E
c) return the name of the department of the authorised user" P7 w3 W; S; U
Individual Data (Maximum 20 marks available)/ Q+ W1 r/ q0 G7 i. ]$ q9 o
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.
" y2 r: \: U: B. @, aDocumentation (Maximum 10 marks available)
0 b5 I' x# w- w4 D9 K" ?, x& c- ~4 y; a6. 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.. @/ C3 {0 U9 Q: x% l( I
BSA104 Business Programming – 2007: Assignment 2
2 W8 k" T. Y7 C4 ^; EPage 3 of 5 |
|