|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
0 |; a4 i$ x! KShanghai - 2007
+ ]1 S* K% f& }# @" B, @- SAssignment 2
7 N' C! g P. lDeadline 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)
: C4 H+ t, {$ {7 T1. 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.- \* c& u" z1 S Z( s. B
The staff must be able to:
$ T% u2 X5 ^! u6 p Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
" I% o9 F7 y/ H( O2 J5 y1. 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.+ L% c* t- I! e" y8 o' A; Y. f
 The interface should provide a menu so that the staff can:$ N" i6 h* u* ^2 s7 M
a) Enter the names of the two Java program files to be compared
0 \+ k: }& ]0 w4 D2 ^; r For this assignment, it will be assumed that the two Java program files are in the same folder as your program." S U, o, T$ C! Q% 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).
' @6 d- Q* M* Y/ I9 s E( kBSA104 Business Programming – 2007: Assignment 2
# ?5 s$ X7 {- G! PPage 2 of 5. E* n; Q' V$ o: C, N% |
b) Print out to the screen all the lines of code that are the same3 Z* J' T0 F$ t+ a* M
 Include the name of the file and the line number of the code being printed for each of the two files
f5 e' F, O; B- V' \; s5 b# ~c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
1 ]# M: Q5 C4 B/ N the name, username and department of the user( A5 T$ i/ E! g1 ]& ]! A5 d
 the statistics of the comparison
# K% v) B: j4 G& Z# U0 L# ]1 W2 {- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
7 Y: t) u7 J- l the recommendation for further checking
! P8 S' G+ \" d- W+ 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 closely" W) C; Z" }3 c+ |1 L5 X3 ~2 ?
 the names of the two files compared
: ?) j8 y; Z" Y/ R, ^! x% ld) Leave the program (exit). {9 K! U, p; h' h+ t5 V* M
The ProgramCompare class: (Total maximum 20 marks available)2 L* U. S. f% y, q
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)
. v- W& L# v9 H' p; ?5 | d3 B& x( Ea) provide an error message if the files are not found or there is a problem opening them5 p1 t# P P* m3 _* j' ~
b) compare each line of code9 ~: b) }3 E0 f3 t$ Q
c) print out the lines that are the same+ c3 b, k& c, `
d) count the number of lines compared / lines the same$ t$ W2 g# c5 X3 q
The AuthorisedUsers class: (Total maximum 20 marks available)
5 M( ?; z$ z w7 \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)
+ N$ C1 D- D) B) y2 b. B- j* F4. Provide methods to:
) s& l6 V4 \/ c7 F* o ~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
; d7 V4 \) ^& E1 u, n! D4 w% l" Fb) return the name of the authorised user
H: ~/ d% @) nc) return the name of the department of the authorised user+ N" ?6 g% O( d [
Individual Data (Maximum 20 marks available)
5 i7 t+ K* F6 m5 n( {8 t5. 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.: V3 W9 K( G$ B- r5 i
Documentation (Maximum 10 marks available)
% A3 N1 n) `. t9 B& {; b$ `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.
" ^( S, U- T2 F* |! |1 R0 L5 Q7 n r1 KBSA104 Business Programming – 2007: Assignment 2
6 }" {* \9 ~- L% n: f! aPage 3 of 5 |
|