|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
0 ~; P3 E. A! D+ S* x. |5 AShanghai - 2007% r$ Q! V; A$ r& f6 g+ c
Assignment 2) n9 `$ h2 U3 t, w
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)0 `) c- P, k# P+ y0 ^5 K' I- \$ C
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.1 F: |( N1 e8 O4 I) W/ x \1 e; _+ o" v
The staff must be able to:9 Q: J+ w1 _7 l* r
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **., D8 `' m" Q ?1 `: F; B6 u
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.) }7 B% R* V K- j5 Y) G
 The interface should provide a menu so that the staff can:
# V5 u! i& T/ P/ [' I8 Xa) Enter the names of the two Java program files to be compared
4 s$ P( U" S! c$ e3 s8 x* ~ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.6 q; l# h4 f) S, k. K/ 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).
9 ^, w4 o; O7 v! ?: y8 ?BSA104 Business Programming – 2007: Assignment 28 U' s9 z; l& U8 E& D, J2 \ V
Page 2 of 5
# f& T5 O1 i5 F& v4 p& sb) Print out to the screen all the lines of code that are the same' M; D6 l N# c' i
 Include the name of the file and the line number of the code being printed for each of the two files
: [/ l3 C# e0 i. F! G$ Cc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
8 D Q( L5 u7 R7 D* Q8 c( w8 K the name, username and department of the user0 n! k" t( |9 b$ D1 s
 the statistics of the comparison
# o0 T2 {) g8 ^- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, Z" b' r* E3 P5 a5 n# D the recommendation for further checking7 N6 ?9 `, b. X' e
- 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 closely6 S: K2 {) W& [/ |7 c
 the names of the two files compared
- r( ?3 W1 M3 X. s- d* Zd) Leave the program (exit)
. w8 e& B9 W4 _, z+ J. GThe ProgramCompare class: (Total maximum 20 marks available)" _- a* |$ o# d" d# L6 d) c
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)
4 I5 I# E$ k0 ^# Ga) provide an error message if the files are not found or there is a problem opening them
" Z* B) y. ^4 ?: Db) compare each line of code" Z" j+ ]! Q. g" d9 Z+ U# e
c) print out the lines that are the same
4 {0 E9 F# w5 z1 h7 dd) count the number of lines compared / lines the same5 f6 b2 f# D0 F, M3 G* t
The AuthorisedUsers class: (Total maximum 20 marks available)# Y# J# U% d# i: ~6 M* _$ n
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)
4 d+ w0 y0 M8 Q3 p7 z" |% P4. Provide methods to:" A9 L7 }; g \7 W
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 match9 c' Y# L/ v/ L8 R; u: ]
b) return the name of the authorised user
2 e2 f, s' Q( l4 [4 Ac) return the name of the department of the authorised user
0 `+ i4 o' o' j$ K# SIndividual Data (Maximum 20 marks available)
* `* u2 N$ L: f& V5 X5 K9 {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.+ r4 M- s8 | O: I& o6 T$ k
Documentation (Maximum 10 marks available)) d1 a. n: A2 x4 p1 |
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.. L" N8 n, @/ K# o! u# e5 [9 q
BSA104 Business Programming – 2007: Assignment 2
* Y l4 w* W' B3 K T) _: \1 FPage 3 of 5 |
|