|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming2 ]& v- h( G& J0 d$ s
Shanghai - 2007
8 ^6 D+ V1 a9 Z+ zAssignment 2
1 [2 F2 I% x8 |9 m; y2 _# E& uDeadline 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)' j& R: j" i2 e' d. A: t) u
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.4 w& w+ @9 c5 m7 k
The staff must be able to:3 u9 @0 a, B& R
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.5 J1 K: D/ C% T* M0 Y8 [5 t
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.6 t8 \6 \8 l* [7 S" B
 The interface should provide a menu so that the staff can:+ T& k' x+ z( b% ]. X
a) Enter the names of the two Java program files to be compared
4 s' H- m! g+ ]% V For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
+ K) c3 L: `6 R* b4 y** 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).& T9 R' l' g6 y7 Z* ]
BSA104 Business Programming – 2007: Assignment 2
% r: y: C- ?" s1 }( R6 TPage 2 of 5
9 D$ ?- A+ a2 y ?9 zb) Print out to the screen all the lines of code that are the same+ |1 E: h. U/ u8 h* s
 Include the name of the file and the line number of the code being printed for each of the two files0 Z' H# R2 ~9 o2 Y
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared V* S" l) E3 c
 the name, username and department of the user
, r7 s9 E R; d, M$ ~+ o the statistics of the comparison
2 R6 n9 M, c# Y9 Y. E- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different9 V' w" r! D5 \$ ~
 the recommendation for further checking
4 c* [4 r$ U9 p8 R* t- 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 closely8 H$ [, O& B2 s5 g
 the names of the two files compared3 G+ e4 {' H$ z
d) Leave the program (exit)+ O# F3 H* J9 l5 a& z/ x% h
The ProgramCompare class: (Total maximum 20 marks available)
; d; c( w1 I. Y0 c# H6 a3 ~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)) R7 U" [+ W- e: j; A
a) provide an error message if the files are not found or there is a problem opening them A4 w5 [, Z2 F. H
b) compare each line of code
Y+ P4 H6 T" @$ ]7 ?' Oc) print out the lines that are the same& b5 b+ X1 _6 Z7 {+ H
d) count the number of lines compared / lines the same# K' j* }1 W% L& o7 Z* {' A( t5 l2 P
The AuthorisedUsers class: (Total maximum 20 marks available)
7 b" Y" s4 y* f' F4 x3. 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)" p0 ~; @: y, C
4. Provide methods to:' P3 m T6 D* O5 w# L
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
& K" [8 S. C. F& jb) return the name of the authorised user3 v4 y! j. A* |, s' w4 C: l
c) return the name of the department of the authorised user
, V/ V# Y, f3 L( Y* jIndividual Data (Maximum 20 marks available). z/ ~6 Z _7 ?
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.% o, \' k8 ?, A5 Z; i+ `- f
Documentation (Maximum 10 marks available)
. Y9 y) w' N3 ?: 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. \9 Y+ N9 k0 D( o2 b; c# c I9 ~/ k C) ^7 d
BSA104 Business Programming – 2007: Assignment 2; I2 Z8 w2 G2 I, L" w
Page 3 of 5 |
|