|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
# |; J" x4 Q% U4 F/ LShanghai - 2007
- _, ?) y( H" @$ H6 c$ Y; IAssignment 2
$ F: M( U# |; F6 O5 L% L4 qDeadline 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)3 S) |" `7 G1 l
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.* {' M* U( ], S ?0 g9 |6 g
The staff must be able to:3 l( z& a r8 o, m
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
v2 [3 f. ^5 k# x, P1. 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.
7 w7 t" ^, n- Q& k$ T' T8 k p The interface should provide a menu so that the staff can:% o5 F, P8 s# e, r4 o% g
a) Enter the names of the two Java program files to be compared" X3 J) @ r& T" v
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.) x* V4 Y+ }# K
** 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).
- K9 H Q/ _1 iBSA104 Business Programming – 2007: Assignment 2& C. Z. L7 m, ?+ a
Page 2 of 5! r- O; f, q0 N5 L: d$ Z
b) Print out to the screen all the lines of code that are the same, S- F+ z* T0 Q$ d! O4 J6 V6 ~8 T5 D
 Include the name of the file and the line number of the code being printed for each of the two files7 r% U8 p* I( `
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared$ X" `: E" B% E: k1 n& v
 the name, username and department of the user% d0 O) W# D' [2 v" s, ~
 the statistics of the comparison5 u8 O [& j- a: u
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different" x# k+ Y! f( o& Z/ S
 the recommendation for further checking c/ }) P, r' C( z' 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 closely9 K* u. c6 a: ^1 v3 }
 the names of the two files compared
2 p* g: z- ?; _( id) Leave the program (exit)
7 W. M3 @" e6 yThe ProgramCompare class: (Total maximum 20 marks available)
5 e5 H' J( m5 s! L2. 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)6 m1 j) ~, ]/ n" V% d
a) provide an error message if the files are not found or there is a problem opening them
8 q0 a% D' C% [1 Qb) compare each line of code
5 o- ?) h: k1 }3 F! a1 Qc) print out the lines that are the same1 ]3 _ E. B- C& n6 A/ ]$ \
d) count the number of lines compared / lines the same! F+ @4 ?$ w# O& b1 {9 P' p
The AuthorisedUsers class: (Total maximum 20 marks available)
9 V8 J2 Y% s7 R2 m. ?9 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 P l5 V7 {- A" r9 m4. Provide methods to:8 |3 S- J$ t( R. g7 R
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 match4 J; U7 F* c8 |$ L: A
b) return the name of the authorised user
* V* v% u7 L, Y5 W# ic) return the name of the department of the authorised user: p/ T9 x+ m3 _" L/ u' D( d
Individual Data (Maximum 20 marks available)
* T3 E: Z) X( N }* q5. 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./ Y! `! `2 n2 Q/ ^5 J
Documentation (Maximum 10 marks available)1 n3 T3 s# D* ]8 }# D# b
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.; Z. M# Y7 F9 q" c9 p& W/ M
BSA104 Business Programming – 2007: Assignment 2
) V3 b+ ^ h9 T+ W _, y9 EPage 3 of 5 |
|