|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming3 ^8 b/ M: f7 B q! N# F
Shanghai - 20078 w% D$ x* {! ^ [5 X. j
Assignment 2/ W8 m* G3 m+ Z- }# r
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)
$ t3 a4 C! o* T0 i1. 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.3 q/ f# H/ w/ F9 k
The staff must be able to:
% H% P6 u) n2 B! s6 b Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., t" S' m+ M) S6 P5 `7 t( Q
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.
' o& c2 b3 b+ v5 B4 \3 E The interface should provide a menu so that the staff can:! x5 {4 G* ~4 ^" f9 D+ e# k8 O
a) Enter the names of the two Java program files to be compared6 k# t" ]; R, n6 X. d7 m3 B7 d
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
^5 C0 d5 j% R' h9 [" U- J; I** 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).$ D/ k# V# h) p
BSA104 Business Programming – 2007: Assignment 2
0 M5 N B4 w9 {Page 2 of 5
$ T$ ]9 ^5 ~- |. s; Q9 {9 B/ A) F* vb) Print out to the screen all the lines of code that are the same
# C; s5 }* K" T( G( \ Include the name of the file and the line number of the code being printed for each of the two files
6 z/ R" z6 \5 s5 \& `* Yc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
; v6 X2 P& |3 S) M' B9 c the name, username and department of the user6 c. m7 a1 x# [, i% E
 the statistics of the comparison E6 B$ i k |; p" r5 ]
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
+ ]1 O! n; Z, {/ z5 j7 h the recommendation for further checking
* q+ W5 S' l# D- 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' ^) U2 |" Q" _5 u9 O
 the names of the two files compared
$ n; C9 o3 f! @) p3 _d) Leave the program (exit)
' _3 A( b9 ^- }6 b1 `& t2 \9 NThe ProgramCompare class: (Total maximum 20 marks available)/ Q) l9 O4 j9 g% ?
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)1 E0 c/ |2 [/ X. K5 ]' Q
a) provide an error message if the files are not found or there is a problem opening them! s3 s- t7 Y* J/ V$ J
b) compare each line of code1 i( u) c8 m" Y
c) print out the lines that are the same
6 A5 o* O6 J- O9 y" [6 y: X. vd) count the number of lines compared / lines the same5 \# Z- K+ \0 o r: H7 x6 M
The AuthorisedUsers class: (Total maximum 20 marks available)! p8 M- g+ T- A+ w2 j/ C) ^9 h
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)- J9 q9 a t- w0 a7 H9 O4 p H, `
4. Provide methods to:9 D4 T. m" q% `3 t/ {
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; v; Z Q4 w4 H. q
b) return the name of the authorised user
& }% ?$ X! l! dc) return the name of the department of the authorised user& k0 d/ _* h8 H8 W
Individual Data (Maximum 20 marks available)0 Q" p& q. b @5 e
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.
- Z9 D$ I+ D) [5 WDocumentation (Maximum 10 marks available)- f: d' k( u" F# N: S8 x
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.5 S. m9 _: @ w) {# B" _, U, Y
BSA104 Business Programming – 2007: Assignment 2
5 B9 _/ L- q. @# u3 h, rPage 3 of 5 |
|