|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming+ F9 r) ]- j+ t: d3 _
Shanghai - 2007
9 t2 Q& u4 T& n( V' j- a* ^Assignment 2' t; g6 K/ g0 e9 c) q- m
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)
! C$ E% r* ~, q; q3 s F; h2 r1. 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.
0 c; i8 B- m0 ^8 y; ]The staff must be able to:
* N. U0 {1 f+ K7 {0 s% _* y Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
0 W% u+ L6 b# H4 y7 p) B1. 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.( k: s8 f0 X7 k4 T3 E3 R$ n
 The interface should provide a menu so that the staff can:" r# t; y2 W" a7 W% |# Q& @
a) Enter the names of the two Java program files to be compared
! M1 S4 q/ Z: M$ I9 L0 | For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
$ z- n3 A, o+ n** 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 |. z5 }- e0 [% H0 x: a
BSA104 Business Programming – 2007: Assignment 27 l4 e4 Z5 b6 B# L7 U+ I
Page 2 of 57 X$ f, I Y5 E
b) Print out to the screen all the lines of code that are the same8 V9 F3 |0 o- a
 Include the name of the file and the line number of the code being printed for each of the two files
7 B: G4 V9 p* I! U% ?: wc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& m9 t6 ~' M3 a3 o6 g. |8 {& l) g the name, username and department of the user
! W2 V1 P K* x7 H- {* K1 x the statistics of the comparison
1 y: [6 l* D( C9 t; W- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
% I0 p# h. b* Q0 x9 W the recommendation for further checking
: F! S: c" K+ G- 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 closely9 M/ J' Q1 ?# x- L
 the names of the two files compared9 S* g @# {$ b; K/ ? ^
d) Leave the program (exit)4 n% J1 Q; c9 E2 K$ E
The ProgramCompare class: (Total maximum 20 marks available)
8 y. }. H# C( c! P, x2. 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)( [. Z$ N/ Q4 M8 n; D- h2 N6 w
a) provide an error message if the files are not found or there is a problem opening them5 N" {, W+ ~9 V# q x* K9 b
b) compare each line of code% ?8 U5 S0 ^! f; a& r& w
c) print out the lines that are the same
8 a, P$ x% Y8 }d) count the number of lines compared / lines the same) E' f% q# R% i. l" U" [
The AuthorisedUsers class: (Total maximum 20 marks available)( M: q* B8 I+ X Q' s
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)
* Y0 R5 V* [9 t2 C4. Provide methods to:
$ G( A+ L9 p9 j* M9 S" [7 ?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
8 v" @7 `( C6 e, X: v4 y( ]b) return the name of the authorised user
# \- V7 z* k6 N( g1 g+ b5 `c) return the name of the department of the authorised user; o! e; y; Z* x! i2 S: ? [( a# ~4 ?
Individual Data (Maximum 20 marks available)
! F2 @- ?4 s0 c+ d3 u& E0 t# y, x$ z5. 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.7 ?3 i( M; S( C2 e& G$ v8 A) S' k
Documentation (Maximum 10 marks available)
$ F6 X; u3 N2 Z, t: O) p6 [- C6. 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.( I* Z/ B6 O" ~( z- [1 M3 z
BSA104 Business Programming – 2007: Assignment 2) c$ i6 I. H) v2 g, Z$ y2 g7 M+ d
Page 3 of 5 |
|