|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
9 A3 d6 m$ M3 j* wShanghai - 20076 a$ e& }8 a+ v
Assignment 2
% x+ l4 N8 U- `0 [1 }% e% DDeadline 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)
% C% ^( O+ C4 A: p6 i. y1. 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 E: Z: d' A3 w' y! W" aThe staff must be able to:
2 Y" k) o# Y. [* g/ ] Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
+ S# @$ N, W3 M, q+ x) F; H1. 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.* c# u+ K( x4 A$ q, m
 The interface should provide a menu so that the staff can:6 d& [6 G/ s/ Z6 O4 O
a) Enter the names of the two Java program files to be compared
: B8 _4 b6 [& Y7 x. `! F0 ^! L For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
# j, ^/ L" h# ~) B** 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).
, k! Q4 I1 }: J: c# JBSA104 Business Programming – 2007: Assignment 2/ [( O' m' g5 U' J+ i0 o* r/ [& E
Page 2 of 53 O! ~6 l! l2 G, j: F9 ^/ x
b) Print out to the screen all the lines of code that are the same
( J4 E n# S+ {- u8 U Include the name of the file and the line number of the code being printed for each of the two files
1 W2 f2 g" G) Z4 Uc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared3 Q# ^( i/ S/ m! O# W( c# `6 D2 l
 the name, username and department of the user
" C! z7 X# m$ ]; k6 W9 B2 k" B the statistics of the comparison& O- ]7 V/ g; i
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different+ K, U! m: s: F# d; @
 the recommendation for further checking3 B- A! G6 w6 S5 [
- 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 closely2 m) @. t7 a1 k: Z: p) R) w3 B- N7 x
 the names of the two files compared' L( U5 C, o& Q4 O- [
d) Leave the program (exit)# r) s+ R) T/ _5 E0 O# R
The ProgramCompare class: (Total maximum 20 marks available)# E2 ? L T- U4 q# }
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)% K" N7 ?( ?$ u
a) provide an error message if the files are not found or there is a problem opening them
, `; S$ ^0 M9 C, }b) compare each line of code
% K6 }8 m+ L9 j3 @c) print out the lines that are the same& i. ?' f( P8 g* e) n) A" ^- [8 F5 y
d) count the number of lines compared / lines the same/ y+ J8 Y% N, n; A2 y- i: u* A% ^! d
The AuthorisedUsers class: (Total maximum 20 marks available)
1 R: B: g0 S& Z# R; m3. 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 j: F3 y: ]# A3 t0 {. d4. Provide methods to:
+ f2 u+ h( L6 o1 j. h& B' p" ta) compare the stored username and PIN with the one entered by the user - return a value that indicates whether they match or do not match4 B; o0 F' Y# H: { N$ i
b) return the name of the authorised user! l3 U3 E7 M! V0 m/ Y3 T: k
c) return the name of the department of the authorised user
& \& N6 d( a# p+ |Individual Data (Maximum 20 marks available)* m' D9 ^1 e6 Y8 | p! _
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.. L' e8 ^8 N# l3 G" O
Documentation (Maximum 10 marks available)
4 s. P' A8 ?3 R0 k# K6. 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.
+ x) ^, H% G* b1 NBSA104 Business Programming – 2007: Assignment 2. u4 g1 \/ e5 f" _; X4 p
Page 3 of 5 |
|