|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 S: a/ ]$ V2 b0 M, Y pShanghai - 20079 N3 ?' P0 \8 S8 P
Assignment 2
- N6 u. C" z" Z. i# wDeadline 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)
`1 x: h5 m& e6 y1. 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.
9 N9 e! L4 n& d/ o$ O/ R9 M/ AThe staff must be able to:
5 X* m, N: _9 N: C1 i% Y Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.( l4 C6 E L4 v, {0 O" R b* N( d
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.
: i8 j" ~/ c b The interface should provide a menu so that the staff can:/ X3 d5 Z4 F3 W- T$ B
a) Enter the names of the two Java program files to be compared' A: ~! D1 ~# `: L
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.0 Q; l4 a: M7 \; X+ m% a- F
** 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)./ ]+ q/ j+ E \- b$ Y6 t6 y
BSA104 Business Programming – 2007: Assignment 2" b8 |; Y1 ]7 }9 t$ ?: k: H6 [/ V5 F
Page 2 of 5
( n' g* z; S7 }4 @, u* ?6 mb) Print out to the screen all the lines of code that are the same
' q `* I* _' k V; v0 F' t: O Include the name of the file and the line number of the code being printed for each of the two files
) F: _0 S8 K+ x) @c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& f: C- C" p O( V9 c8 Y the name, username and department of the user
/ w z3 r7 X+ @. R' I$ U the statistics of the comparison& p, Q# A, @, o+ P
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different% }0 ], Q! O4 o6 g. X) |' w$ F
 the recommendation for further checking
% J2 R2 G9 C- ^/ D: L" w- 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) m/ N. A/ Z the names of the two files compared
7 H6 Z1 ~' x$ Y4 T) f [2 md) Leave the program (exit)1 Q. x% u2 l3 [* U1 Z
The ProgramCompare class: (Total maximum 20 marks available)" W2 ^& I/ Y0 F* H/ h! E
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)/ {8 t3 s, D6 h
a) provide an error message if the files are not found or there is a problem opening them) h! {3 R9 b5 ]1 Q* k9 ~
b) compare each line of code
7 s5 K# h4 }( r) Z" J! l, z1 D Yc) print out the lines that are the same
: j" g% B* A; Wd) count the number of lines compared / lines the same
2 {* w5 A F( X) y3 MThe AuthorisedUsers class: (Total maximum 20 marks available)
5 H& A0 U- s b6 p) R* U" G- i3. 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). p; Z( u7 l Q; N
4. Provide methods to:& M9 T$ q2 V; s: m: D6 H- v4 X7 |
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
/ o( \' i* F# @5 Gb) return the name of the authorised user
& |' L# }' M9 c7 q( f6 D7 rc) return the name of the department of the authorised user
! r/ t+ j2 g# ^4 _* r; Q5 NIndividual Data (Maximum 20 marks available)# c* j: z" L' C! ]4 M
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.' l/ G2 Q0 E( K- Y
Documentation (Maximum 10 marks available)
) }( y1 c! Y" h0 h* M2 M! }" X8 F6. 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.
3 j& n: Z! A" J% ]+ ]1 V, QBSA104 Business Programming – 2007: Assignment 2
$ Y4 m: p" f/ N% D8 mPage 3 of 5 |
|