|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
2 k$ Z% K/ b2 G: {9 iShanghai - 2007: d+ G5 j. Z E8 g9 _: G- |% s: L
Assignment 2
6 Z- I8 E/ H7 e' `, V/ |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)
$ k9 R9 d0 H W- S5 a& o4 e1. 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.
6 F* @! Q+ x7 Q1 f1 hThe staff must be able to:
% y/ h8 w+ b; ?, c6 h Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
, x1 s h4 Z5 N/ s/ n1. 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.
/ J5 t, B$ v; ~' j, d' N/ L The interface should provide a menu so that the staff can:
# Q1 {. G1 a1 _# Ea) Enter the names of the two Java program files to be compared' ?, R2 q* Q5 E7 S: |6 w- a( J1 A/ U
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.( g! [, M7 C+ c: }0 Z) J1 ^2 h! \
** 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).
: n2 Q7 K$ L1 @$ v, \+ LBSA104 Business Programming – 2007: Assignment 2
9 t" a7 w4 ]" {: B$ FPage 2 of 5, t0 x: w( n& e# ~
b) Print out to the screen all the lines of code that are the same
, [3 ?* }# @; T( k Include the name of the file and the line number of the code being printed for each of the two files+ u' ?, c }: e: h) O! J) a& T
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
+ O( C# Z8 c3 W$ r: p5 \' I/ L the name, username and department of the user
6 w6 H& k; x+ V, b the statistics of the comparison0 l( a6 ^- L! E ?' Q# }, B3 C
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, u, }9 X0 [5 u0 `; v the recommendation for further checking
* k8 }: C: {4 G0 i' ?" V; b& 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 closely$ H4 {; U8 I8 J; ~* O4 l7 c, f+ z
 the names of the two files compared/ g% q4 S. z' F0 R4 Q& i0 B3 x7 `
d) Leave the program (exit)
6 T6 I# j! D2 C# X8 Y+ @. gThe ProgramCompare class: (Total maximum 20 marks available)
. \- ~. r7 d6 l3 ?4 _! z/ R; G2. 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)
0 Z- D5 b8 w" N) Q- ^3 B& z2 Ha) provide an error message if the files are not found or there is a problem opening them
! ]5 r& ~9 z! f4 v# i3 {/ bb) compare each line of code
: c" U" M' P3 U1 N; w7 m( o$ Bc) print out the lines that are the same @/ v9 s; V( L: H
d) count the number of lines compared / lines the same1 r$ h% m$ G: q2 } h: `2 e% I0 }
The AuthorisedUsers class: (Total maximum 20 marks available)
9 p) ?$ M# D5 @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)
; F, @3 ^ Z5 ^3 B3 z4. Provide methods to:5 D0 I! ^& }9 b
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# p9 ~% e% N9 F d7 j1 w
b) return the name of the authorised user5 G1 G( T' t& F' g# R
c) return the name of the department of the authorised user( N6 f4 N9 R! X0 A7 S. j, q" c
Individual Data (Maximum 20 marks available)# i, s4 F& r! m0 Z% ~0 d0 d
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.
' I% t* P; u; [" s% d* RDocumentation (Maximum 10 marks available)- \" G, _/ Z5 {( ~, b8 Q4 n
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.
; K/ K3 P% `! G+ R, TBSA104 Business Programming – 2007: Assignment 2+ C4 a) i: i/ q% h& @
Page 3 of 5 |
|