|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming4 p4 _) z" y( M% W' B, H9 o& s; e/ t9 ]
Shanghai - 2007
, t7 c5 m2 g5 i3 N$ ?( }Assignment 2
4 A" r8 _4 `) y6 F; Y* l/ E2 }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)
& V% t$ E1 I( u2 Z6 T1. 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.: R! b* h% m/ ?3 c
The staff must be able to:& d$ x& N" \# }9 h& K) p: k$ }
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
3 P9 t+ j6 E/ Y. _# x" K) e- o# 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.
* N, p# s5 w+ x3 j& [- ` The interface should provide a menu so that the staff can:/ ]$ c( ]. K# h0 z) v
a) Enter the names of the two Java program files to be compared
) Q/ b3 v W) I; J% D3 i For this assignment, it will be assumed that the two Java program files are in the same folder as your program.8 v# L) R, {' P7 V- z- \5 g* S
** 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).
: K; C/ g7 l8 f% G, YBSA104 Business Programming – 2007: Assignment 2( p4 S( { ~/ ^9 |* K* [
Page 2 of 5; U: [0 B& l2 a( i* Q
b) Print out to the screen all the lines of code that are the same
' L, \4 Z3 l# N5 b4 f+ x- ^ Include the name of the file and the line number of the code being printed for each of the two files
+ i# [/ o" f8 Qc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
, B+ g6 ]2 q5 ?( f3 Q9 ?& u! Y the name, username and department of the user0 G. Z, ~- [8 r @
 the statistics of the comparison" _( R0 E0 r" a* K8 z& r
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different/ c E: h. h% C* Y# F5 b
 the recommendation for further checking
; \$ E3 j0 [: w9 r% {' E# 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
+ ?# D1 [, I1 a9 Y7 ^% O% u& X the names of the two files compared# F* {) }; x6 C" |7 W
d) Leave the program (exit). i, d2 T' L9 h5 _. h( j$ m
The ProgramCompare class: (Total maximum 20 marks available)* w: J/ R1 y% T/ D9 b+ V2 T3 M6 ]
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)
5 T; b; s& |/ @& Na) provide an error message if the files are not found or there is a problem opening them
% j: r3 X4 `/ `1 v. Hb) compare each line of code) a1 J" T o* M' e7 D/ P
c) print out the lines that are the same0 l% i+ z5 X7 g3 S1 K b
d) count the number of lines compared / lines the same6 e5 ]9 |% B) P
The AuthorisedUsers class: (Total maximum 20 marks available)+ l% \* P" A p8 K' |3 H4 D: 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)
8 }) ]$ t" {* \ M x. ]1 ~4. Provide methods to: R8 {* S6 w( z/ V% j
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 match4 a# E) r0 I1 d* f, s5 E& v0 N: |* l
b) return the name of the authorised user
% ]/ h; ]5 \* J8 n0 b8 @$ ]c) return the name of the department of the authorised user/ }( C' C- [5 ^: U: u$ O6 m @
Individual Data (Maximum 20 marks available)3 l9 Y6 C; d% f, t
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.) J+ U1 B, s! p- }1 Q9 B
Documentation (Maximum 10 marks available)1 |+ {- q* |# @ Z$ 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./ f, m& C' w$ m. M* J! f5 d
BSA104 Business Programming – 2007: Assignment 2; \( x& l" r0 y4 X7 _% ~
Page 3 of 5 |
|