|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. j% ]" z0 u" r. k& g ^& F: a$ m
Shanghai - 2007
' D0 e" \: I9 [Assignment 2" F# D# t6 C5 Y: o! N- a( `6 B
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)8 n' o/ ]; m) G# A% u3 U: w
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.
& K3 S1 o& A9 l# z* @* b; {The staff must be able to:
% J, U+ \7 K3 h# D" `; V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.# Y# Q, z: {: i* @# n
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.; S$ F9 o) b% g9 M( B
 The interface should provide a menu so that the staff can:% V) U- R2 N" a' R
a) Enter the names of the two Java program files to be compared
4 E9 D, S" y* u4 X7 U. L For this assignment, it will be assumed that the two Java program files are in the same folder as your program.2 Y3 G- p# r8 C
** 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).
" D/ r& }# A2 v& u' `+ XBSA104 Business Programming – 2007: Assignment 2
' T( h5 [, B2 t# I* u6 E" j4 L) APage 2 of 5! F: C5 C0 V6 V* [( K
b) Print out to the screen all the lines of code that are the same+ S6 v; h- E' q% n8 T. M, V# ]
 Include the name of the file and the line number of the code being printed for each of the two files
. x, Q7 u f- b! n* tc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& c7 o/ b3 S" N4 O8 l# A5 n+ h the name, username and department of the user
* j* J' T$ [% S3 p+ m the statistics of the comparison9 \$ i7 O V) d& ~
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different3 f! Z4 F! r$ f
 the recommendation for further checking0 T3 |( T" i" S* m7 M; g3 a0 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
5 R! \% w3 ?! d8 V the names of the two files compared
& l$ h( p5 m/ M5 L8 bd) Leave the program (exit)
- k8 b4 B' z/ g) KThe ProgramCompare class: (Total maximum 20 marks available)
* m6 N8 z- U# M9 [) K7 M2. 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)
) p$ @5 v# f9 r& w9 ~4 ra) provide an error message if the files are not found or there is a problem opening them
4 V. I4 `0 E% {0 _5 b0 t Qb) compare each line of code1 k B5 F( M+ ~
c) print out the lines that are the same9 \: T' {. O8 [* h$ q, w2 I0 Z
d) count the number of lines compared / lines the same$ c! h8 ?( M# a T8 Z, c* [( b
The AuthorisedUsers class: (Total maximum 20 marks available)
. `2 k4 i0 p: i+ ?6 ~+ W" ^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), Y& l* l( s" j# O ^, D4 ~2 X
4. Provide methods to:; s6 X6 ?( f% h4 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
7 ]9 S% r4 |) rb) return the name of the authorised user
0 A3 D, \% j) Q! @4 yc) return the name of the department of the authorised user
; M9 v5 U/ @( v+ i7 WIndividual Data (Maximum 20 marks available)0 r5 h: Z q0 A) Y$ B0 ?
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.
3 f8 \: N, {/ j5 o2 T8 aDocumentation (Maximum 10 marks available)
+ R8 p) W; }/ |% f: d6. 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./ S5 D2 d2 i5 S' G
BSA104 Business Programming – 2007: Assignment 2* @2 T+ S; X* [4 K) ?/ M1 a
Page 3 of 5 |
|