|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming/ I7 {. V: T; F9 ?
Shanghai - 2007) _3 f# i( I7 z% f, D+ O6 D
Assignment 2$ N4 ~. ?: o; q5 T
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)
4 T, |- S* T2 L0 g$ Z7 Z1. 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.- f2 z: d2 k: k3 E
The staff must be able to:
* D% r m/ o( g Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.) o( P2 J9 f5 r& K
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.
. v) b. k9 ^3 f The interface should provide a menu so that the staff can:
( S: i4 q- e$ R7 N( ~* g; Z% Za) Enter the names of the two Java program files to be compared7 h6 j E0 {8 e
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
. x6 L3 R; U3 l3 A" w** 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). i: P; f! L1 c) e5 ?
BSA104 Business Programming – 2007: Assignment 2& ^- z: }* T/ y8 u
Page 2 of 5/ r0 L3 Z& C) X7 I+ X- ~
b) Print out to the screen all the lines of code that are the same
7 k3 {& c R0 N0 U Include the name of the file and the line number of the code being printed for each of the two files+ ?( @0 q' ^1 N2 ?5 j, v T
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
: j' {8 b! Q9 g: Z5 c the name, username and department of the user8 _) z+ v6 u$ @0 J
 the statistics of the comparison
3 S( a% G# Z- `- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different: J3 Q) [9 V0 G# w3 n8 Y0 U1 B
 the recommendation for further checking
4 y8 H i0 s, |+ b9 u- S- 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( P0 ? Z) G$ M6 j9 G- J
 the names of the two files compared
1 M# Y8 n$ T0 y, O" G$ @d) Leave the program (exit)9 V/ z* l1 e+ w& z3 t
The ProgramCompare class: (Total maximum 20 marks available)
1 _$ T! s* I9 R* }9 }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)
' j, D+ E0 D. k1 Ya) provide an error message if the files are not found or there is a problem opening them& _. ~! ~3 I" l' u7 u
b) compare each line of code) @$ Y9 \0 M; M) k
c) print out the lines that are the same5 w v7 T. m3 G' a6 l, H2 O
d) count the number of lines compared / lines the same5 D# y& {$ K8 Y) b
The AuthorisedUsers class: (Total maximum 20 marks available)# k6 q3 [% f2 ~" Z) `: v3 a" l6 g1 \
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)1 M9 q" E' x' {/ K) h8 E: J2 ]
4. Provide methods to:' w8 r3 j" g0 j x, f
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/ }" {. O9 P3 K- `+ l- k9 |
b) return the name of the authorised user( C2 w- d- X- r1 {
c) return the name of the department of the authorised user
Q5 X% [! W. U2 X. a5 A; I* h: z8 X+ M' D$ FIndividual Data (Maximum 20 marks available); r) \" k+ Z8 d3 l
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.
9 z+ h( R6 }% v: i! JDocumentation (Maximum 10 marks available)
8 E0 c+ ]1 b) ]% Q3 ?3 H# R8 s* z6. 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.% ]0 b" D/ i" X0 c
BSA104 Business Programming – 2007: Assignment 2
5 L; o1 M* _. n! D4 k2 l/ w, A. `. rPage 3 of 5 |
|