|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
" ], a5 G# O3 I/ F! N- [( W) _Shanghai - 2007' |% M5 e0 M* ?* z
Assignment 2( m+ ], d0 {7 ]) D 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)7 y1 R5 x+ m+ g- J) q7 l
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" u& a V9 z# Z
The staff must be able to:
5 o/ O$ w; r! k& e# d/ z! D1 K6 Y* m5 @ Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.3 J/ [' K1 A5 V3 ?( W
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 c! H* B+ M5 @ }' j8 J: k
 The interface should provide a menu so that the staff can:* H/ p+ s d: |
a) Enter the names of the two Java program files to be compared; x% h) |/ R s+ P$ q8 V d% r
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.8 H7 K" R+ X' X% B; l% {0 ^
** 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+ r6 @6 Z: Z' U/ Z( s! e
BSA104 Business Programming – 2007: Assignment 2" S, W9 R! t* ]% x# `
Page 2 of 5* M9 `0 n! f d) F4 H9 w6 N
b) Print out to the screen all the lines of code that are the same4 Z7 I& d2 d6 j/ [9 p# N
 Include the name of the file and the line number of the code being printed for each of the two files
Q2 W: h) {: v3 i9 jc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared. d5 M l8 C; d; m. @! C
 the name, username and department of the user
% ?! V) e) q+ \7 E% } the statistics of the comparison
( l! A- a k) n3 f$ Q; \- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
, g4 p1 ~2 ~! w9 {% O/ D/ k the recommendation for further checking
% ?1 Z5 h* Q( v- 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
0 u$ n+ A# N W8 l; x3 R the names of the two files compared
& z# {6 R9 n* }d) Leave the program (exit)9 C4 {/ z$ D: h" e5 f# ]* Q
The ProgramCompare class: (Total maximum 20 marks available)0 `1 Z: S0 Z+ E& C5 F9 K7 g4 m# M
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)+ Z3 E) _; n+ L4 X. @
a) provide an error message if the files are not found or there is a problem opening them4 ^# o5 R. J! p, m
b) compare each line of code
! ]! v8 S0 U' t4 x: |# v. s/ ^c) print out the lines that are the same
9 b {7 S, I* x, P4 \d) count the number of lines compared / lines the same5 H7 `7 j$ R, {) }
The AuthorisedUsers class: (Total maximum 20 marks available)4 v) F. S8 B2 s4 }; ` 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)
0 V& O+ h! o& Q6 |; F, I4. Provide methods to:
8 F3 P* T3 a9 c& a' h j/ k1 u+ ^7 ia) 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
1 s0 k O, \9 {' M, Tb) return the name of the authorised user2 M9 F, v5 H6 U! S: A U7 B$ o' @
c) return the name of the department of the authorised user6 _0 Q! ] m0 c& N3 Q2 M6 O1 m7 G
Individual Data (Maximum 20 marks available)
: Y- e* P- ~6 [* v5. 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.
8 f) [2 G/ O5 `) L' dDocumentation (Maximum 10 marks available)$ {+ {1 q# n+ j% L
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.' N+ B! M& C0 d i# w3 S% e
BSA104 Business Programming – 2007: Assignment 2# M0 ^, ~1 Y! l7 h' I+ q {) p: @
Page 3 of 5 |
|