|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming8 h. q8 H3 u& z) U% _. l
Shanghai - 2007% m; S2 l4 M: a) L+ g# |4 V
Assignment 2+ U! C3 a9 g3 G
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 t5 W9 k$ V- n% c# i4 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.
" S, r' \ X# v4 }The staff must be able to:% _6 u: o4 l" {8 W# J" J$ a
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.1 q8 Z1 P' P1 q" d
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.7 D( T. ]" T4 s% [) l
 The interface should provide a menu so that the staff can:1 f1 G2 m; Y) ], t( `
a) Enter the names of the two Java program files to be compared- M) Y- S% @$ M1 u c: Q1 T5 N. q
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
( q E1 b$ `. a& t, S! 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).0 [- L j; _0 G9 ~% ^1 }, g6 D
BSA104 Business Programming – 2007: Assignment 2
5 m A" |) a( o% q# B7 H0 GPage 2 of 5! _0 O9 X4 a& |7 F! Y
b) Print out to the screen all the lines of code that are the same h" A9 G1 U1 T$ Y& U4 e9 R
 Include the name of the file and the line number of the code being printed for each of the two files
3 y( L$ R( m5 y, {c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
+ [0 A) S9 b. r# ?& L, @( D the name, username and department of the user1 K) Z: b/ @5 o5 G
 the statistics of the comparison
* N- S0 b, S, z2 E1 n$ C2 ~- Z5 |- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
2 S; G: P4 B6 K! b5 l; |5 J the recommendation for further checking
) ^8 B9 F# }1 t2 J* c- 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) T: w: Z/ _8 O* _) G& C$ W }
 the names of the two files compared3 |5 d z/ B, o8 @7 v
d) Leave the program (exit)
+ D, Q) y9 Q f- h, m8 Q0 t ^The ProgramCompare class: (Total maximum 20 marks available)' E0 S4 [+ J; a+ m/ c
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)
: u4 s- Q' V9 V' | y/ ia) provide an error message if the files are not found or there is a problem opening them, D0 H. |# H* T9 Q3 \* J! O
b) compare each line of code+ S! b. p C! m2 k
c) print out the lines that are the same
1 j* [' C* x& m% m1 p$ R) Zd) count the number of lines compared / lines the same) m2 u1 g; i! j4 z7 K$ O4 ]) r& _
The AuthorisedUsers class: (Total maximum 20 marks available)
% f$ c O$ S7 u3 V& d+ u3. 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 [$ R! P1 L$ b( f! n* y4. Provide methods to:
$ J+ ?# z" ~! D d' g5 M( E8 Sa) 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+ V: R: I. H m* a3 h' _0 |! e+ t! O( r
b) return the name of the authorised user
5 p+ ^- T0 B4 S! i! @: Oc) return the name of the department of the authorised user
1 {! _, J7 C7 t! Z$ U+ L [. o2 @Individual Data (Maximum 20 marks available), E# L' T: |% i- h0 s
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.6 o; J- U; g3 `7 a1 H3 Z
Documentation (Maximum 10 marks available), d. e" t/ L- a
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.% l( k3 i5 a5 {9 Y
BSA104 Business Programming – 2007: Assignment 2
! z7 C: d3 {8 r: H9 SPage 3 of 5 |
|