|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming2 D4 _/ d {/ L: g2 s' [( C& z
Shanghai - 2007
" E& u* ~; r% \7 t4 VAssignment 2
' g$ x; m9 ] C8 HDeadline 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)
* D' c# {2 L) O0 q. \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.
* e4 w3 U R, n+ WThe staff must be able to:
+ X+ D# q( Q) s% V Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.9 w# x7 c% {! `2 x8 C
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.& J8 i4 I$ F5 y5 p8 p
 The interface should provide a menu so that the staff can:
( B, g% w' v6 p6 ^a) Enter the names of the two Java program files to be compared# P5 Y4 D( a" w+ s3 ~" e
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.; b3 L$ i$ J% W' s/ t- 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).
* W8 ^& g6 f* i9 K4 F3 WBSA104 Business Programming – 2007: Assignment 2
, t$ i; ?7 }7 D7 g" G7 ]& MPage 2 of 5/ _) M# D. ?; c! l& e7 o
b) Print out to the screen all the lines of code that are the same
: _! y* v; R- t" ~8 B$ I Include the name of the file and the line number of the code being printed for each of the two files3 k! A& E' I n. \+ W2 R5 m
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared' y- a" W( x* e6 z) I2 O
 the name, username and department of the user
3 [$ h" {/ `0 P0 u4 @: n6 l the statistics of the comparison, i1 h3 J% Q. \1 E; [
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different! U R% U7 |+ |
 the recommendation for further checking
1 q: y& i1 a' n% X- 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
, ^% d0 d/ k; O7 e the names of the two files compared
* W2 u9 Y" X* Ed) Leave the program (exit)
7 Q% z4 b6 N8 P# eThe ProgramCompare class: (Total maximum 20 marks available)% B$ X& I! b5 K
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)
; E* F0 Z) x0 C0 H+ Ja) provide an error message if the files are not found or there is a problem opening them5 U. ]! g8 o6 \: }8 B0 E
b) compare each line of code
. \: d# @: F# E; Y5 Wc) print out the lines that are the same! {8 ~+ q! v- A( ?5 z; i! y( Y
d) count the number of lines compared / lines the same6 m3 i5 i* p+ Y" f& h4 Q
The AuthorisedUsers class: (Total maximum 20 marks available)
! ^8 {2 v0 ]# H S3. 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)
, l$ J2 u/ g* O4. Provide methods to:* _3 d( u- ~# @, S I. g
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
( H/ a3 r. h# H9 F7 U' `5 \, B1 l# Sb) return the name of the authorised user
) n! V: l9 E* v- S6 z- q3 B' Lc) return the name of the department of the authorised user5 q% g$ c) [# O" A6 n5 v$ y" v
Individual Data (Maximum 20 marks available)
/ L/ ]9 n! X+ Y2 r3 U" m5. 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.
' Z( } P+ L6 ?Documentation (Maximum 10 marks available)7 i1 ~: k% M% V3 K+ d: E# R
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. M$ h/ N2 W/ B4 \) l7 y$ e1 x/ h
BSA104 Business Programming – 2007: Assignment 26 ]) E/ U. E. R- W- Z. M! r
Page 3 of 5 |
|