|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
) V! |! n3 e$ ^& X1 [: G$ ^; ^. H$ yShanghai - 2007
' l" g. K* D( }* v, yAssignment 27 I2 t9 H1 ^2 E: 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)2 S+ [4 I g k/ \5 D0 H
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 H) X, J! F' C2 T" b, GThe staff must be able to:4 R3 K; {5 n8 u) b1 S* G3 x
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.& C3 ~9 E0 Q! N8 @3 M. 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.
+ j: u3 d' J! d! u6 q The interface should provide a menu so that the staff can:9 ~) o( q! o0 B. T2 [/ s
a) Enter the names of the two Java program files to be compared9 k" U0 J$ H; P0 G8 E
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.. D5 Y1 H- O. B. o" |* I) _
** 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).* B. ~3 k/ c$ {2 a1 l* z
BSA104 Business Programming – 2007: Assignment 2# p, s" @. @7 p% u2 A' F
Page 2 of 5* [, ?! H9 o& u8 {( X2 `; F5 d
b) Print out to the screen all the lines of code that are the same1 Z# b. K6 k8 p# [
 Include the name of the file and the line number of the code being printed for each of the two files$ X9 q! z8 k: z6 K9 f- ~/ u0 t
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) @ k! t0 G- [' B7 P
 the name, username and department of the user" T- M5 R8 O2 W9 T9 H
 the statistics of the comparison# Y! o* q+ c0 j! i6 s+ a, g
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different) ]$ Q+ l$ h- D7 M5 B
 the recommendation for further checking
: \, N4 ?, L' w k! H5 G% A7 ^6 T- 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 closely8 `8 z- w4 j. c# D
 the names of the two files compared
0 w2 p. H% v% x9 [4 cd) Leave the program (exit)3 G) P+ z6 b# e8 U" ~: J2 I; k3 v
The ProgramCompare class: (Total maximum 20 marks available)8 y$ }/ c8 A4 ]5 S R* Z
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); N' y _; S* x! O5 |. y% u
a) provide an error message if the files are not found or there is a problem opening them& R( y: ?0 I$ g, E1 u! j/ T
b) compare each line of code8 ], x! ?( P7 R" H+ B0 G- K3 d$ l1 z
c) print out the lines that are the same
8 s* J5 H5 x) B/ U I1 Wd) count the number of lines compared / lines the same$ D0 N" b6 N: E3 D0 D( @, Z
The AuthorisedUsers class: (Total maximum 20 marks available)' i5 N! b) m+ }
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)
- H& ?. f! E o& ]) L4. Provide methods to:$ T* F! s* d$ g, |( |7 N
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+ B4 {! \# U3 X3 K: I5 D6 U
b) return the name of the authorised user
" {4 Z' ^0 P, U9 pc) return the name of the department of the authorised user3 ~8 I! `5 e, f9 m
Individual Data (Maximum 20 marks available)( K2 C7 z8 J$ |
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 [) S8 P9 Q0 ^3 @* _ z6 U
Documentation (Maximum 10 marks available)
$ x) Y: ]: _% c6. 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! f( W) h# G u B2 _4 g- c
BSA104 Business Programming – 2007: Assignment 2
4 p0 n) @5 h; n# q9 XPage 3 of 5 |
|