|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
! m! B* m, p+ C$ j& ], D0 LShanghai - 2007
9 L/ \& `8 }! I) [, [ c8 KAssignment 2" \$ h2 Z. S9 O1 _7 _
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)
}: N/ f6 d+ E4 W1. 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.
; j; K* S& Z; C- D$ i( ]The staff must be able to:
9 K6 h! l, N/ K6 ]5 V- F Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.5 s' X( h$ x4 v
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.1 r$ C8 S( X4 i5 A) s
 The interface should provide a menu so that the staff can:2 h- N: N: D- C' e. w
a) Enter the names of the two Java program files to be compared* i8 K' d# Y- D7 G0 Z( b; p
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.) y6 W: }# O3 Y, a0 x- [( a+ F
** 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).1 ~, C, l4 E: q' @* @* ]- D, ^
BSA104 Business Programming – 2007: Assignment 21 y! \: x* z- ~0 l( S8 w
Page 2 of 5! S' t% G u) N5 W
b) Print out to the screen all the lines of code that are the same
" F2 m& M; N$ d1 p# w& r4 {3 e Include the name of the file and the line number of the code being printed for each of the two files3 {" n B b4 R% E
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
9 l6 o8 G; W) @! e. o7 ]' A: p the name, username and department of the user* G/ ^8 g4 t6 g
 the statistics of the comparison
3 V# p" A* C; a) ~9 Y- R) t- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
/ \" T& C5 R/ ?% X' `1 q4 q the recommendation for further checking4 H8 D' Y' s/ 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 closely) I, ~- L# x4 {8 a) Y; W" u
 the names of the two files compared( Q3 w( G5 p) M { L2 _+ s& p
d) Leave the program (exit)% a) U3 r% X9 n$ i. b
The ProgramCompare class: (Total maximum 20 marks available): Z' k! {& K# S
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)
; R$ u- X0 L7 N$ E& o! \- Wa) provide an error message if the files are not found or there is a problem opening them7 i% k' o0 w& }% E! E8 T5 H+ k: v
b) compare each line of code. ~' m% ^, \1 w
c) print out the lines that are the same" n8 T; `/ P% G7 Z
d) count the number of lines compared / lines the same
& L0 R1 w3 r! l- Q- e1 GThe AuthorisedUsers class: (Total maximum 20 marks available)
- c! y/ G f0 L/ Y* V9 P3. 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)7 g! t W% f; r# j: c! q5 o
4. Provide methods to:
! |$ @" W- C( }0 s2 }4 e+ [ K- ]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
% }- T/ z# Z! r S: @) u/ Zb) return the name of the authorised user
( h8 f0 V9 a3 i7 [' t4 r/ Rc) return the name of the department of the authorised user8 l& O r; P% O% j/ M& l H1 H
Individual Data (Maximum 20 marks available), Y4 T5 A7 n: \2 _; B% b1 {/ \3 o2 `8 I
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.
& } j4 t0 p5 |3 dDocumentation (Maximum 10 marks available)! m9 I$ p2 A1 G
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.
- j5 t/ {2 \- d2 HBSA104 Business Programming – 2007: Assignment 2
/ I {. Y" n8 R `: z# @Page 3 of 5 |
|