|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming- m6 t8 i7 G7 O5 q8 X4 }, z7 B: M
Shanghai - 2007
* }" b+ i6 i: N2 X5 @! @Assignment 21 j! P. @! t. I5 t; V
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)' A/ c( c# {. `, \. D
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.
3 I7 T3 p7 G8 @% y. KThe staff must be able to:
' c% r1 X( Y# I+ _1 Y2 N Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.# D2 G- k9 a( q( x9 s2 ^
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.
6 \+ d( X1 }3 t& o4 Z The interface should provide a menu so that the staff can:+ j s: r2 w* D- R& z8 m; U7 D& i
a) Enter the names of the two Java program files to be compared
: j9 l# O M: {6 z4 T For this assignment, it will be assumed that the two Java program files are in the same folder as your program.4 y% j. W8 l- {+ m
** 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).
$ R7 M k6 l, [& E5 }3 E9 {6 CBSA104 Business Programming – 2007: Assignment 2
, p$ H9 Q3 u. \. B% L* ^# v- A% q# k, YPage 2 of 5
, a( [/ |$ l: W! r x+ x' }b) Print out to the screen all the lines of code that are the same* s' C1 E; V7 g% @8 m) ~$ L" t
 Include the name of the file and the line number of the code being printed for each of the two files# u! v$ i: g9 \
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared& \+ \7 s! O% M% X: z# s- N
 the name, username and department of the user: n0 R& n* g8 b% b6 ]
 the statistics of the comparison) d) v+ _+ F0 [( I
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different& b' M- k. z/ m8 e. F- \: x
 the recommendation for further checking. j; u5 q0 I v3 v ~8 U7 _3 h
- 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, F. i5 ~( d/ ]- a4 V the names of the two files compared9 o( a1 F3 @: ~6 n2 G
d) Leave the program (exit)
+ K3 O, G+ o1 H/ }# rThe ProgramCompare class: (Total maximum 20 marks available)
8 ?+ {" R4 `9 g B1 m2. 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)
% M" B* |1 d5 E" q: |6 ja) provide an error message if the files are not found or there is a problem opening them
; R4 G4 L+ I8 Q9 P4 r+ d. k3 L9 W- ^b) compare each line of code6 x7 _9 a) T: o: \6 p4 b
c) print out the lines that are the same6 t2 I. ]- J- |
d) count the number of lines compared / lines the same2 n8 V& w& a6 P1 |- W5 b& g
The AuthorisedUsers class: (Total maximum 20 marks available)7 B9 w& ?2 [4 |
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)) _* `7 z; Q9 u- C6 k. a5 J' I
4. Provide methods to:
% c' l0 b- Q! `) q' {" ~5 |2 Ka) 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, o" i+ X: n) ?- S) K5 [. Z6 Z
b) return the name of the authorised user
7 k( r9 v* G0 }% ?c) return the name of the department of the authorised user m1 d2 M7 Y1 \& v2 \! U6 Y6 Y
Individual Data (Maximum 20 marks available)
, J+ D9 u2 m0 y5 U2 A4 ]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." h6 w5 U# c! C. t* B
Documentation (Maximum 10 marks available)
6 `2 w, V0 N& D$ y6. 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.5 x: K. G6 j5 U, i- p! M
BSA104 Business Programming – 2007: Assignment 2$ _' w' z, ~. @; q0 g- A
Page 3 of 5 |
|