|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ d2 J/ X1 {, ~6 C
Shanghai - 2007) X& R: l$ W, v5 F* I, ~2 c& ^
Assignment 25 T9 Q: } E6 I
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 V6 }; `0 N% F3 X6 D% I# u$ D
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.! m: J5 j4 N0 |/ h3 z3 D
The staff must be able to:
& }4 _8 O! C, q1 y8 Z0 y% q Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
: a4 O+ X; H- I, F$ P1. 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.
0 A: N9 G7 o) A5 m3 o* a% S; w The interface should provide a menu so that the staff can:
7 t' a3 v1 F" u) ]a) Enter the names of the two Java program files to be compared. p m5 E3 b, V$ p6 b5 `
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
4 {5 k* a. J) _ ?) T$ H: \** 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).0 ^! F, b0 K$ E
BSA104 Business Programming – 2007: Assignment 2. F5 x, K3 N& F7 }; z/ z$ k6 U' K& k$ R
Page 2 of 5
' t8 A) F4 {( Db) Print out to the screen all the lines of code that are the same4 j: i$ V$ r) C0 E# @
 Include the name of the file and the line number of the code being printed for each of the two files# D+ |* u$ p$ j5 T% D; h
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared% U7 D% o. N. z) E" u2 e
 the name, username and department of the user
! c% a3 V/ c) \3 w- A( U g+ o the statistics of the comparison
4 ?. r: u3 W& G& w- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
# U: d7 k4 _ c# l the recommendation for further checking: M2 ^# v1 T- k' a: o0 X
- 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
# ~+ J; [- f, v3 [ the names of the two files compared
: q) K0 v4 u1 m; u$ I% kd) Leave the program (exit)
. y) k/ j' w; k8 t, J* f; f! K+ ?6 EThe ProgramCompare class: (Total maximum 20 marks available)" V( I! e! Q9 t+ }" v. s2 h
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)
5 K6 L4 k# k/ T- d$ \, d2 }a) provide an error message if the files are not found or there is a problem opening them
1 C1 c s! v7 Q. _3 {7 Sb) compare each line of code6 O( r1 Z/ F; C* R4 U+ V; \
c) print out the lines that are the same6 G( m7 Z" G- t7 ]3 U$ y& I
d) count the number of lines compared / lines the same( H) F+ ?0 ^5 k$ C. s
The AuthorisedUsers class: (Total maximum 20 marks available)
; d, j) ^- R2 J! k4 f0 }: W3. 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)8 e3 i1 u: D% [% @
4. Provide methods to:
4 i: k( c0 g6 o, Y: B `5 Pa) 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
# K& V1 Y+ ]- c* z" mb) return the name of the authorised user
' D* b1 J* u& |% _( mc) return the name of the department of the authorised user( U: Z. M* C5 C7 g, \1 ]7 W) j
Individual Data (Maximum 20 marks available)4 T8 G( y2 M, ~1 O
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.4 f5 d4 w7 E% M( n
Documentation (Maximum 10 marks available)/ w$ `5 P5 Y0 n1 R. W
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.+ T a. ^6 _$ n2 k4 [2 Q- d
BSA104 Business Programming – 2007: Assignment 28 [6 @8 X$ ^$ ^
Page 3 of 5 |
|