|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming5 x9 k. W Y: ]- A `
Shanghai - 20078 I9 @' M- W. l1 u* q- m( S; j
Assignment 2# r6 R8 H4 f! J: r' x* o
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) K* m/ @, r- _' p3 O
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.
" t& a- T: o' M( _: j# M# K; pThe staff must be able to:
, P$ w( [& m% L- R( Z( Z; V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
0 Q+ T/ J* [) D, H! l: K! S. V' w1. 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 T7 F0 ?3 {8 K! L) e8 B" y% C
 The interface should provide a menu so that the staff can:
5 n6 F! g8 `$ R6 w; }a) Enter the names of the two Java program files to be compared. r" { R$ i, x0 ^3 |+ B6 u
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 k2 t9 c# _4 I3 ^3 B, }, U6 u** 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).
4 d) a- [, ]5 zBSA104 Business Programming – 2007: Assignment 2$ Z8 L; a! |6 T2 j x6 v, [
Page 2 of 50 I3 a& R" J8 K {- R6 |2 m. ]
b) Print out to the screen all the lines of code that are the same
' r6 j0 b0 w9 p" q" `9 M* i Include the name of the file and the line number of the code being printed for each of the two files6 v9 T1 R: r- n$ g& S& b
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
, J% K* r- H6 j% T: m' k( s the name, username and department of the user
7 q- Z6 S9 \* x3 t+ Y) G( A/ c, N the statistics of the comparison* g# j. @4 R! h$ C
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different! D' z9 b! E! `4 g- e; ~
 the recommendation for further checking: h- A6 y% H1 g+ _( 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
+ Y! m! h. W, n5 s; a4 ` the names of the two files compared u8 S0 f* I7 ^0 E. I, Y8 M7 j& \
d) Leave the program (exit)) ^. H! n) d, E4 v. @
The ProgramCompare class: (Total maximum 20 marks available); h2 n6 ~1 J; I6 ?4 U+ 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)
: b, q; Q4 @- I# r! W0 q: Ja) provide an error message if the files are not found or there is a problem opening them
4 h/ W4 v! Z# C wb) compare each line of code( c. c& J' i( b+ {6 [
c) print out the lines that are the same
( a' t5 ^& C: Q' f+ `- }d) count the number of lines compared / lines the same
0 G% ~3 ]& F& \3 m; XThe AuthorisedUsers class: (Total maximum 20 marks available)9 ]+ O: |% U$ I: Y9 T d
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)# Z4 Z" j( t2 O; i
4. Provide methods to:+ T' _& E# e$ W) d
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
- f( [# a: ]0 C0 Q5 u8 Db) return the name of the authorised user
( g9 _7 F: o4 T( \c) return the name of the department of the authorised user! S, I; ~$ z) n8 Z4 r
Individual Data (Maximum 20 marks available)2 B- g$ q- u1 P8 D& x2 {& y( M
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.
/ o6 k L% u' r! T9 k% EDocumentation (Maximum 10 marks available)
* a# B' p; D$ G( x( R6. 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.( O& k2 r W3 I. A
BSA104 Business Programming – 2007: Assignment 2/ q8 l! K0 c: S3 g) k% ^
Page 3 of 5 |
|