|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ y% X# s- a* I+ y
Shanghai - 2007
4 V/ o/ G' w( d; y- z! hAssignment 2
. ~% v4 r8 `, l' Y* pDeadline 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)
- f- K1 F7 S! w% X1. 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.
+ {: [$ f0 J3 O( j8 _The staff must be able to:
5 p" W" @4 E9 m# _1 D1 ~ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.8 ]" Z6 K% B- _! h; I' 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.! ]/ p' D* Y: u+ N1 e( g" H/ J# n
 The interface should provide a menu so that the staff can:
: h' b4 N; M3 oa) Enter the names of the two Java program files to be compared
# p5 C, K2 ?) g. B0 t2 C For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
) \7 B5 q5 } e! J** 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).# a( g* }# [' X3 X
BSA104 Business Programming – 2007: Assignment 2! d1 | V, w; P5 m+ b
Page 2 of 5# w# x; L& q/ @, L6 @0 ~: l
b) Print out to the screen all the lines of code that are the same
/ a; a! O% @# D: ~& { c ?& Y Include the name of the file and the line number of the code being printed for each of the two files
6 C% g% _( a. N. bc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared8 V* l8 L% K- N2 \
 the name, username and department of the user
6 f% I" y/ i3 [ the statistics of the comparison9 z/ h. z! W! n8 W$ i
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
$ Q9 [$ X% S1 Y5 r1 s the recommendation for further checking
" Y( I; C% h' ]& O* H5 v" C- 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 closely4 Q: v2 Y5 f6 n2 }( ~1 n
 the names of the two files compared
# u+ q I/ H: I& p3 v9 l7 v. Ed) Leave the program (exit)& `1 H! P. w# s. t7 z& x) Y$ C, ~
The ProgramCompare class: (Total maximum 20 marks available)- T% @& j- a. Z& ?- a! x
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% p9 g+ x: T1 B: w
a) provide an error message if the files are not found or there is a problem opening them& p9 t- X8 k' m j- W
b) compare each line of code- O: u( T) s$ B$ j& k0 h4 N1 p$ b
c) print out the lines that are the same, L4 F o' _& U# F8 ?5 {6 \
d) count the number of lines compared / lines the same; E6 \) L% z7 q# R1 B# |$ M
The AuthorisedUsers class: (Total maximum 20 marks available)& E! u. j1 b# R. m( f1 @
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)1 B- R9 o0 N. m' ^1 p
4. Provide methods to:
. _$ r, p1 n9 @, s6 m; J7 ]4 v3 n1 Ja) 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
+ f8 l6 J2 @- c P. J( ^6 \b) return the name of the authorised user) X c8 }: ^' {* F5 h
c) return the name of the department of the authorised user
4 ^0 q9 o7 @* g+ v! b2 HIndividual Data (Maximum 20 marks available)& [4 C. M8 E. c4 F" o# c2 N7 c# q" |! S
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.
. V- z$ O' ?% v% c8 y( W1 XDocumentation (Maximum 10 marks available)
E$ c$ j2 o g; |+ N/ {1 Z, o6. 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.3 y4 q4 K4 f# t. d8 H2 z
BSA104 Business Programming – 2007: Assignment 22 y1 R) Q) o7 {) Z4 k5 O9 ]
Page 3 of 5 |
|