|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
4 h: J# m" ^2 W) X* F8 h* PShanghai - 20070 c0 D7 t/ C. A- i/ G9 p/ S
Assignment 2
5 i1 k& v. Q$ i! uDeadline 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), A) `( [# Y. I# a
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.
9 u- J" m) S& I8 nThe staff must be able to:3 ?+ n" w# e2 y; K/ v- O( X8 Z; l
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.$ u& f7 {6 M6 J" 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.
- J% M" G; O0 U% d The interface should provide a menu so that the staff can:+ X/ O1 S1 S7 H1 j% p. w; l `/ q9 ]! m
a) Enter the names of the two Java program files to be compared w% x$ M# _8 `3 y
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.: G y+ k j2 c, d0 R; E8 x! |
** 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).
# L) T2 W1 B( F' y( ]BSA104 Business Programming – 2007: Assignment 20 i) i+ V4 ?7 y1 \! \ Z# v9 m
Page 2 of 5$ i2 ^! ~( e) v: H
b) Print out to the screen all the lines of code that are the same+ D/ z) O' A: h6 K% y% o! A4 w
 Include the name of the file and the line number of the code being printed for each of the two files
' T1 b" t% h, F h$ k- g) ]c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
- _0 s; b3 _: e5 \ the name, username and department of the user) M: S) O7 S. i C4 u: P' _8 z1 v
 the statistics of the comparison
# D) M2 r/ C1 w2 ?- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different2 Q" k! k, n0 Z
 the recommendation for further checking
7 s u1 _6 s8 ]# I2 R- 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
1 L) F: ^' |' J the names of the two files compared
* e6 M) Z- W8 z' b9 G1 td) Leave the program (exit)
0 ]' h5 W( u( {! `The ProgramCompare class: (Total maximum 20 marks available)
) @2 A/ B, l& o, L0 _& O2. 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)
9 V' w. F1 ^4 V9 M4 g" I& \a) provide an error message if the files are not found or there is a problem opening them
# H( x- e: z) sb) compare each line of code% M6 _) k4 M2 P" N) N! ?3 p( E c+ p
c) print out the lines that are the same4 E# i% T7 W: V* e9 j$ l3 d) Z& i& Q( j
d) count the number of lines compared / lines the same
- S( V% g8 q$ [* C3 |6 B- DThe AuthorisedUsers class: (Total maximum 20 marks available)
: \! b8 o9 }% w- Q2 J# G# e, `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)5 p9 N7 Z: J' x3 f/ U' A5 l
4. Provide methods to:2 y- {, r- N" X A
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 match7 ^+ J$ v4 {8 |0 K, u
b) return the name of the authorised user6 C; b- [; x0 Z5 J
c) return the name of the department of the authorised user
# ?$ Y+ X- _% ^Individual Data (Maximum 20 marks available)
9 J% Q% F6 @. {. ~& I W5. 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.7 u+ E. @$ p2 u; r
Documentation (Maximum 10 marks available)7 a4 L' t7 i: b" w& v
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.+ y: r* \9 s8 v0 F4 l0 l q
BSA104 Business Programming – 2007: Assignment 2
Q r; q5 w: R: n' U7 aPage 3 of 5 |
|