|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming: e8 E- Y! u, k& t
Shanghai - 2007' R* m8 d! T; y9 T7 u" q
Assignment 20 l4 }% e2 {$ m5 K6 K
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 G, e$ F* \" c8 `- V! }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.
9 r) Y9 i( E- k$ M3 s% AThe staff must be able to:0 B% z" ]4 M9 f8 n4 H9 s4 ?
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
& g9 w+ m$ }# ~# r+ {& x8 T# V* u' V1. 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.
* r' {) O* @" L! v The interface should provide a menu so that the staff can:
2 L/ S9 s8 H6 ea) Enter the names of the two Java program files to be compared% z1 `2 i; T" m! p8 v$ z
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
7 j! n' @# m& V* M5 P* [1 k** 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).5 d: |/ e+ D1 ^: H
BSA104 Business Programming – 2007: Assignment 2/ b* j5 F" ?/ V2 L
Page 2 of 5 S* a& P2 p7 W% `, f1 D
b) Print out to the screen all the lines of code that are the same$ w. d' R s" O' m0 j/ ~7 o
 Include the name of the file and the line number of the code being printed for each of the two files+ _1 E8 ?( |3 k+ e2 e6 N
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
# d- F% U! f3 c# d8 | the name, username and department of the user$ g$ d: f* O3 {. Q" n" V( H9 v
 the statistics of the comparison
, W m6 w$ b/ f* V4 W9 H+ } A3 ~3 G% T* F- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
6 w2 U* Z k8 Z! r: _* ~ the recommendation for further checking7 p3 N6 R: G- u$ o$ I
- 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 z* j" @$ H6 n6 B, i) @/ K the names of the two files compared
/ C) F5 h' k' v1 Y: O" h5 id) Leave the program (exit)
* q6 a( @: q7 y: h5 k0 A# _8 [The ProgramCompare class: (Total maximum 20 marks available)+ y) n- n% e8 s1 y: g
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)& Q5 M. t4 C4 ^
a) provide an error message if the files are not found or there is a problem opening them$ c1 t0 @" @( v; `
b) compare each line of code* q8 n: V4 h. p* N) H
c) print out the lines that are the same
1 e% M( U; m3 W$ ^d) count the number of lines compared / lines the same. e2 B0 V' }$ O
The AuthorisedUsers class: (Total maximum 20 marks available)
( n5 J3 ~' @! V, {( j+ d) 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)$ H. s% F$ I4 `& [. B
4. Provide methods to:
# q6 J: m; A. S! l0 Z1 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; c+ y, B0 e7 [5 d' `9 A, O4 }# ^
b) return the name of the authorised user
' x6 h, [+ m; S# K8 Q% @c) return the name of the department of the authorised user; m4 h3 u: g; A3 |
Individual Data (Maximum 20 marks available)
; |6 \% Z; W& O% g5. 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.9 j, B) p# ^ L: w2 l9 I
Documentation (Maximum 10 marks available)$ K2 M. q W c- Y' }
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.8 P7 C. g6 I/ T5 I6 T ]0 y/ x3 J
BSA104 Business Programming – 2007: Assignment 2$ L! a0 e8 b& O9 B, p; F
Page 3 of 5 |
|