|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming( i( U% D* P( U5 F2 X1 ?
Shanghai - 2007
& f! @9 Q+ |6 }- EAssignment 2
; J6 b; j* {) HDeadline 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)# `0 r0 a F: F2 p4 {0 g! ^/ E
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.
2 A: O" S$ {! ^/ C7 C2 Q" wThe staff must be able to:2 W) a9 u7 d/ U: W7 R) x5 a
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.7 I8 r' b, N) a6 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.
4 e, X' ^- `, X1 \$ { The interface should provide a menu so that the staff can:
& @, O/ ^0 N- U1 ]# e4 Ca) Enter the names of the two Java program files to be compared. _; n$ H4 D$ ?' Z. a" u! o
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program. ~# r# k: x+ V1 I1 U$ u
** 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).( g; ^: `8 O0 X6 `; h2 s
BSA104 Business Programming – 2007: Assignment 2
8 d2 f0 U: p' m! _( oPage 2 of 5
1 A7 {1 Q, J" e+ |& |5 zb) Print out to the screen all the lines of code that are the same
( s+ {0 X7 K0 ~* m v1 w# I Include the name of the file and the line number of the code being printed for each of the two files
/ K4 F, k, H6 W; _c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared" R& k1 N7 u9 T+ ]7 t% R( E. d% h) i# j
 the name, username and department of the user2 g7 ^, D& K9 d) U
 the statistics of the comparison
5 V" R5 V" {& p$ Z- s- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: V3 u! P- F$ k& @1 r, ~
 the recommendation for further checking
4 y! k# y8 K5 \0 U/ |- {- 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 closely0 ?, K& E I6 S, q4 E. D' F
 the names of the two files compared
. h% ~6 ~/ ^$ l7 }d) Leave the program (exit): [+ h3 g3 c# c: m% _1 _
The ProgramCompare class: (Total maximum 20 marks available)3 Y$ T' W4 k8 t0 |
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): j" G0 G' G+ u9 f! O; {5 M5 V
a) provide an error message if the files are not found or there is a problem opening them
, H P2 I. o8 n$ `0 d8 v: H, qb) compare each line of code- y2 F- r6 _% c8 x( g& @$ Z
c) print out the lines that are the same4 l8 d- {" }6 U
d) count the number of lines compared / lines the same
6 M. R0 Z2 R5 K) C7 W$ c* nThe AuthorisedUsers class: (Total maximum 20 marks available)8 t3 x6 i/ Z% c2 x/ \# P
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)& ?3 G( ]$ N5 D
4. Provide methods to:5 b7 G0 [ u! P1 v
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
( K2 I6 `0 B6 h* w! A- m# kb) return the name of the authorised user
8 B% k3 u I: N* X" D% j- dc) return the name of the department of the authorised user
' s O' y9 d; B5 A- \" DIndividual Data (Maximum 20 marks available)# D0 S6 `5 B7 W
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.; c4 J- V, P& U5 o
Documentation (Maximum 10 marks available)
' M& ^4 I" t+ F% v7 K3 ]7 q5 z6. 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.5 X, ]% M& A1 }. D+ s1 d
BSA104 Business Programming – 2007: Assignment 2
! e& ^& [ g8 c0 E8 Z, K. {Page 3 of 5 |
|