|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
: p7 G: z8 o8 j |Shanghai - 2007; L- [1 H- |6 U# [
Assignment 2, e3 S7 l! Z3 C
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: J) y0 ~' z) M& e3 D
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.- ^$ U: A9 i! W) I. ~
The staff must be able to:
; i( B: Y: h' {: J( O1 J Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 W; U ]/ o5 I5 b
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.
/ x- N4 J% w9 T4 X E( J The interface should provide a menu so that the staff can:
2 T# F" _3 w/ x( r( w% Ma) Enter the names of the two Java program files to be compared) K& c4 h* V: k6 H
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 p6 I6 _) W1 G** 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 i) o- f, F6 sBSA104 Business Programming – 2007: Assignment 2$ s% j l3 ~, I
Page 2 of 5
! b3 v c. i. Gb) Print out to the screen all the lines of code that are the same
7 W7 c1 m1 r8 @2 w7 ^" k- @. p Include the name of the file and the line number of the code being printed for each of the two files- j9 ~5 v- t- n
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared) p' C) }, J0 j* \# _
 the name, username and department of the user8 d E p# J1 Z" ^
 the statistics of the comparison
5 @2 E, y3 N6 X& @' l5 Y- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different$ l7 s7 h1 N7 i* _8 Y/ J" `
 the recommendation for further checking
& s' k! r. e/ l( y6 |6 e: O% B# j. O- 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
" s9 A D. ]3 C0 Y the names of the two files compared9 J0 q4 Q, O4 a
d) Leave the program (exit)
9 P5 L! _) Z1 I+ z6 _* Z( TThe ProgramCompare class: (Total maximum 20 marks available)
5 e/ P! |) h9 ~8 |, G# {# G) R9 e2. 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)6 Y- R; n1 Y y7 r
a) provide an error message if the files are not found or there is a problem opening them8 w" h$ `3 i6 C. `$ t, F# u
b) compare each line of code
% N. |/ o% M$ o0 U9 ic) print out the lines that are the same. @! l7 K# Q8 C/ W( r
d) count the number of lines compared / lines the same
' W1 [8 m' S; L; vThe AuthorisedUsers class: (Total maximum 20 marks available)
, [3 f& h$ P. q3. 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), P5 K6 f& Y- D9 G# h
4. Provide methods to:7 x( c; W0 `, y h% Q
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
8 V8 v5 S1 L4 U0 p4 B, F. Pb) return the name of the authorised user
4 e' e* ?8 z$ c" ^ h1 qc) return the name of the department of the authorised user. a, Z$ P9 V- Y1 G8 i7 t( o+ ]
Individual Data (Maximum 20 marks available)( k0 P8 x; b9 \ b# j) X* |) H
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.
; ~( ?- M( q H+ a4 N: N# @: t( vDocumentation (Maximum 10 marks available)
' e. Y! F$ g5 E% v6. 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.
) E7 p$ F7 t9 R3 @" l* @8 ]BSA104 Business Programming – 2007: Assignment 2- D& O0 o. f/ t$ t- l
Page 3 of 5 |
|