|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming9 A; W- j5 t: G2 o2 \/ X1 ]* s
Shanghai - 2007& x' f! z# G- f6 |4 ]
Assignment 22 u$ W( g8 } w9 U
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)
) ` u5 L% e4 H2 N; [ {1 g$ N1. 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% _' ^, q9 |4 bThe staff must be able to:) h' |/ H: c4 _9 c, a( E. z. g0 J9 r0 T
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **. h$ A: I- W; @2 l
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.$ q6 [7 l* s* i. r1 d2 Y. W8 P, U
 The interface should provide a menu so that the staff can:6 R) U: {# o" c9 S5 p2 w
a) Enter the names of the two Java program files to be compared2 S! ?' l2 J& e" Z# `
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.8 X6 n6 K1 y: r: N2 Q" w
** 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).
; z# a+ U) ~. I. E6 Z9 G# lBSA104 Business Programming – 2007: Assignment 2* J* A* z: J7 {6 U. L' ], z
Page 2 of 5# E/ N8 k2 p! b1 @ c( F' {
b) Print out to the screen all the lines of code that are the same
8 N* O- m1 M( h8 s# x5 k! N9 p/ O Include the name of the file and the line number of the code being printed for each of the two files
. n% O3 Q' ~+ N# }7 q9 `c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 w( }! }. z3 [- ^; s
 the name, username and department of the user) v" ]: P* W7 E4 F
 the statistics of the comparison
1 x# f3 l5 q* ?+ X3 j y! k- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ ` j* n0 C' s/ e
 the recommendation for further checking
* Q5 a0 K9 u1 q; T3 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- O3 p! L+ G: N# H, H# K
 the names of the two files compared
& ?' i- V- B: B" w' P! _d) Leave the program (exit)
; N4 m- M8 c) e# hThe ProgramCompare class: (Total maximum 20 marks available)2 {9 N: R ?) N- B+ W. f
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)" G8 [: Z6 {: T0 p- k5 T9 g6 a& A
a) provide an error message if the files are not found or there is a problem opening them
& K6 L0 U, h; y9 ^7 n( j* v' u! |( wb) compare each line of code
3 H0 X* T l) B2 G) L8 fc) print out the lines that are the same
) {0 f* [8 ]6 U, }& K: z1 nd) count the number of lines compared / lines the same
5 y* a& a( T0 ^# p# D3 \5 K1 T ~The AuthorisedUsers class: (Total maximum 20 marks available), m3 ]% d) Q! C& C6 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)) A7 @7 e5 K, J9 `- j
4. Provide methods to:
- Z: I% i& t6 w, _) D+ e+ xa) 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' s7 |9 [# o" O' ]6 w, x" b% {' p
b) return the name of the authorised user
- X/ B, ~7 h, o4 L1 l& h% B3 ?c) return the name of the department of the authorised user, y' G- o8 }$ d( N+ ?0 y
Individual Data (Maximum 20 marks available)
* U* o3 Q7 A8 G. G. J3 l5. 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.+ q5 |& |. n; J' L/ ~$ C) v+ t
Documentation (Maximum 10 marks available)4 }/ c( y2 t: 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.5 w- y0 e8 f7 c; }5 \" h/ h
BSA104 Business Programming – 2007: Assignment 2
+ ^3 q1 o/ ?' c& x" r) jPage 3 of 5 |
|