|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
3 v5 q1 T; g- z! C/ U: N, _Shanghai - 2007
( A/ g; i5 y, R; Q2 g' M$ X6 x9 gAssignment 2# E# h* V' U# p
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 ^3 r* J3 q& t8 B% T
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 @1 U4 l* J1 \! z0 T6 tThe staff must be able to:
. w0 }$ x3 F5 J, t3 \1 E7 { Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
: X. C! R7 n" _9 U g4 S1. 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.
6 H+ @, _% G- C0 J4 W0 n4 L: c! L The interface should provide a menu so that the staff can:
9 ~. G7 M# K, l" }' g5 O. k; ia) Enter the names of the two Java program files to be compared
, J3 k: D0 y- A" E* A For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
) U! X3 u% p& I* V# A) C8 R** 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).
& k5 V% y1 n; J. j+ o/ _: qBSA104 Business Programming – 2007: Assignment 2
/ b6 R/ H* D& i7 z! Y) oPage 2 of 5; {# [8 [0 q( o
b) Print out to the screen all the lines of code that are the same5 _7 q! c7 I8 D h9 d; K+ K1 H
 Include the name of the file and the line number of the code being printed for each of the two files
# w% Z# @6 z& _c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 g1 K) F ]* t1 F
 the name, username and department of the user
: J+ x, m9 m; O# b# J the statistics of the comparison% D$ k* d) L r0 V8 y1 w
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different. `7 a7 K1 X. w% y+ D* j
 the recommendation for further checking; z! T( `' m/ Z0 z- o. 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# }* p; e( y- q2 w6 u4 G, p
 the names of the two files compared
# _: c F v* o. ], pd) Leave the program (exit)# P7 S! H! r" o: U
The ProgramCompare class: (Total maximum 20 marks available)
7 N% p p& ^8 Q# t' W2. 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)
+ m5 L! _, Y( u( Xa) provide an error message if the files are not found or there is a problem opening them8 V! h8 K3 m) C$ j; Y+ E5 I2 t- |
b) compare each line of code8 P5 l4 J9 I' B) _; z# t3 c
c) print out the lines that are the same
0 ^: O2 C B) t' g/ Y; a1 Cd) count the number of lines compared / lines the same( a* [* L K+ M: M5 {
The AuthorisedUsers class: (Total maximum 20 marks available)
+ e. s6 k/ e2 v# {* P3. 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)
. r/ ?4 R, Q( B/ D. ?4 ^4. Provide methods to:; A- K- c- k' ^' [/ s 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 match0 T) Q4 c8 {# F0 q, G5 x5 E# O
b) return the name of the authorised user
2 y7 d3 `! {$ l3 R8 I! ?c) return the name of the department of the authorised user
) h$ C' n. d$ `) Z( c! FIndividual Data (Maximum 20 marks available)5 c# c0 `, [' w4 G& o" ^& A
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.2 N' }; W: e) y) A7 \ G3 J$ _) `1 @
Documentation (Maximum 10 marks available)
; d i. U9 Z( z6. 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.
, Q1 K$ t+ ?" fBSA104 Business Programming – 2007: Assignment 2
, d. n7 x$ V. L) O( g" g) X4 ]+ pPage 3 of 5 |
|