|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming7 h+ ^( T+ L% m7 T7 F
Shanghai - 2007" o5 j) {& l& |
Assignment 2' C; U' y& c* x2 P1 _; i' `) a
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)4 w# B0 e. I! { \ |
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.
3 G4 D1 l* F5 J4 d2 K4 ^The staff must be able to:7 w3 Z9 S1 M9 `! w. r4 v
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 h( X; M. }% D4 J- L* d
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.
2 o. [8 Q3 G6 e* J7 |! E/ w& K The interface should provide a menu so that the staff can:" E0 o! q/ L# r) q
a) Enter the names of the two Java program files to be compared
2 C1 g! g% k) s% ^- G; d For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
! N3 {5 k* G H# |( d, v; W) 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).
) Q' L0 m, X" e# a$ i- q4 l& s) wBSA104 Business Programming – 2007: Assignment 21 D0 ?0 a9 N h: B
Page 2 of 5) \+ U* g8 l/ a2 U0 I1 @+ m
b) Print out to the screen all the lines of code that are the same
' N `: z5 ~. N5 @8 I Include the name of the file and the line number of the code being printed for each of the two files1 T6 ?9 o% M- [2 R1 }7 R' `
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 _, y- f9 ~6 l; D
 the name, username and department of the user* u& ~- |# C) M3 ?
 the statistics of the comparison
0 w. y1 }, C N- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
4 e$ o, a; d8 p the recommendation for further checking
; Y! A, `! i) D! h# `- 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 closely7 O& e% G. o7 ]3 H
 the names of the two files compared
* F& i, o3 f. bd) Leave the program (exit)
3 W" X5 z/ z. w. eThe ProgramCompare class: (Total maximum 20 marks available)
# v* k% z" I4 _% c( C2. 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)
$ N1 e% u7 F# X4 ?a) provide an error message if the files are not found or there is a problem opening them2 N' d4 P; P3 S( a& S9 P1 J
b) compare each line of code9 u& R4 V' j) S" n- @" \' z9 I( M4 X
c) print out the lines that are the same9 u) `9 O7 ]; G5 J- w
d) count the number of lines compared / lines the same' b t4 O; f5 w, g* |
The AuthorisedUsers class: (Total maximum 20 marks available)
" b5 Z6 g5 R. z2 J3 \/ 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)
$ U/ X) X0 G8 x2 `$ M. y) D# A4. Provide methods to:: `# U0 C6 A4 C3 X0 n! A# H9 F( k
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
5 t# p8 B0 d# j0 a9 F, X7 Ub) return the name of the authorised user+ J, Y& ]$ Q& J
c) return the name of the department of the authorised user
0 j& i# S" f5 yIndividual Data (Maximum 20 marks available)( x3 ?5 W) ?" N- E8 ]9 }$ v
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.6 N- x, p/ k* Z" U+ X3 y
Documentation (Maximum 10 marks available)
* A+ ~( v/ J% Z5 ]( a6. 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.6 E5 J! V+ h! X5 \) i
BSA104 Business Programming – 2007: Assignment 2
" W6 W# I, Z' J( i {Page 3 of 5 |
|