|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
$ `- F# A7 O/ S( I# v6 g) tShanghai - 2007
" q9 p3 |. i) t+ s& f( q- z) k2 mAssignment 21 e0 R; s. C6 O/ F/ ^/ \0 i9 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)" N/ G3 {' ^& w. i9 \& D: ]$ B: }
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.
' n: @' X* J: z$ V" N6 K G& BThe staff must be able to:0 q5 C9 f Z# o4 U- E( r, U$ |: F( p9 \+ X
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.2 a* a3 u! U. |9 B! e2 P
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.
4 ]& e# {, o* U6 Y" ^7 [ The interface should provide a menu so that the staff can:8 \" w1 o2 j5 E; Y( m
a) Enter the names of the two Java program files to be compared0 ~' i' h4 `# e: c% @; M' d+ V
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
0 O5 d$ t9 l5 z, M& `& U& g8 T** 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 c& L: y" {9 N( E* E& ?" {( eBSA104 Business Programming – 2007: Assignment 2
+ F; c" y8 S6 yPage 2 of 5
. k$ A3 l& _* A5 `7 F# @b) Print out to the screen all the lines of code that are the same
+ |4 u; n5 E, R Include the name of the file and the line number of the code being printed for each of the two files6 Q# ]+ }. {# E4 R
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
- G' F0 X5 a7 @7 b* G the name, username and department of the user) }; I2 l5 n, V
 the statistics of the comparison \. _9 U" w& h* r) l
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
% o, D, y* |4 c/ o2 a* W the recommendation for further checking
8 }3 g, U) s* B) Y% T+ ?1 ~: h. @- 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
+ Y q6 U1 Y/ {7 D5 m X/ t the names of the two files compared' S4 p8 Z6 K+ L% ^/ x u! K
d) Leave the program (exit)
% k- M# s+ C9 k& N8 r5 d2 C/ _The ProgramCompare class: (Total maximum 20 marks available)
# J; {4 R& z- x9 n0 [# o+ _6 ~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)
# h5 d2 i5 o' [4 ]1 C( A& Q: Na) provide an error message if the files are not found or there is a problem opening them8 e. [4 [% X M% F" J
b) compare each line of code
- m' O% i9 u4 H$ o" Tc) print out the lines that are the same
& ]- v, P q. {: c' ~5 md) count the number of lines compared / lines the same
7 E2 e) u/ X$ x" q( }* b7 J8 v+ j5 PThe AuthorisedUsers class: (Total maximum 20 marks available)
1 J8 r6 R5 b0 T% k# t+ M( L: H3. 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" D3 O# K* C3 K5 ^4. Provide methods to:( u# n5 @' v' E$ P2 l. s5 M0 m6 z, O
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 match
6 e2 S# J' k; ?* W8 l3 sb) return the name of the authorised user
- L4 a. e* ^5 x/ o* B/ Hc) return the name of the department of the authorised user% U8 Q% G% Y1 ]
Individual Data (Maximum 20 marks available)
7 }+ Z3 s& k4 s) ^; b8 n5. 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.3 C; Z, O+ q9 }6 Z& X
Documentation (Maximum 10 marks available). Z3 n: O4 A: p6 e
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.
# d7 D/ m1 w& t, s( v' ?BSA104 Business Programming – 2007: Assignment 2
- S6 A! u) H7 c" s. KPage 3 of 5 |
|