|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
- w* O0 {! h) x$ U* V" ]5 E7 }8 PShanghai - 2007
# o0 L! M* O) {( SAssignment 2" N) Q/ x& h+ ~1 C0 q! X, D, H2 j
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)* Y E8 q4 r8 K
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.5 k& O8 d G, }4 m* k3 |
The staff must be able to:7 P" j! ? w0 q1 W" O+ F2 `
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
" t' I' D& y/ z4 L$ m1. 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.: y# ~8 t5 z- I
 The interface should provide a menu so that the staff can:5 I8 K+ L7 b8 ~8 Z9 c/ }
a) Enter the names of the two Java program files to be compared
; J8 K- X3 g U: w# q: O For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
+ w9 Z" e6 `* S( q* ~** 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).
4 D ~; |# s% k- IBSA104 Business Programming – 2007: Assignment 2
" K# S2 H4 {( m6 \* ~0 {+ ], M) o9 Q8 qPage 2 of 59 S; {0 x" u7 V' |3 y& W5 @7 B
b) Print out to the screen all the lines of code that are the same4 a, _! H3 o/ A& e/ n& }
 Include the name of the file and the line number of the code being printed for each of the two files/ W- P d3 l1 E2 b6 X9 B3 }
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
# s8 f! Y4 h# E; u( i$ y the name, username and department of the user/ f! Y& s2 J0 b( F
 the statistics of the comparison- N: v# z# W! O7 y+ ]) H
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
% { m1 m- @5 t) Q+ E the recommendation for further checking0 k" a# D0 h; n( O$ S! p! 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, x! [0 p, t4 j* D( `6 v# }
 the names of the two files compared8 W) ?( B( |9 @' Z* W" U
d) Leave the program (exit)
% h3 p/ @* W1 ^/ W0 CThe ProgramCompare class: (Total maximum 20 marks available)
! G0 e; q' U [0 J' ~( b7 `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)
% B+ Q& j( C+ W2 Y) [a) provide an error message if the files are not found or there is a problem opening them
! i8 ?; ^) x: p5 l& Q2 @b) compare each line of code6 U8 U" w8 s" Z' R" z
c) print out the lines that are the same: ]- l( N' H6 @" r6 i
d) count the number of lines compared / lines the same
: t# j1 B* C3 d5 oThe AuthorisedUsers class: (Total maximum 20 marks available)
4 |) z6 t1 v/ B4 J, |1 o% K3. 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)
: N# E, l5 O9 V5 a5 ]3 w, A4. Provide methods to:
0 |, o( c' u, \" D2 l9 f$ Y O, Ya) 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
+ G9 s7 _5 ?9 ~7 K6 o: t; ub) return the name of the authorised user
& _7 o: J: g% x; d F# Hc) return the name of the department of the authorised user7 D% j) i* O) {2 \5 h* \4 m
Individual Data (Maximum 20 marks available)
- |9 ^! X3 r$ R7 b6 ^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." t" c# w9 m% l6 g
Documentation (Maximum 10 marks available). f& M8 f; V% G* u4 z; G; z
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.
; I; {: ^3 O1 m8 H" u/ x7 I, B ]! BBSA104 Business Programming – 2007: Assignment 2# s3 ^' V* i1 m4 k
Page 3 of 5 |
|