|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
; n5 n4 e+ v1 r3 m) w& _5 Z' `Shanghai - 2007
0 {/ d9 @ d: bAssignment 2" Y8 t3 q! Z5 R R$ {
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)) O% n& C& H! Y% R0 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.
6 X6 F0 Q6 K1 c, xThe staff must be able to:: [1 l) h2 h. C) h
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
% w$ [9 f$ Q5 o4 a4 _) n1. 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.8 S4 V% e7 V/ J& ?
 The interface should provide a menu so that the staff can:
/ \' K$ \- r4 [5 Ea) Enter the names of the two Java program files to be compared
2 L/ X! p6 N8 J9 U6 {: @% x For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 f; A5 x) [- S0 f, w( D** 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).
- m1 @7 C7 {9 [4 S" ZBSA104 Business Programming – 2007: Assignment 2, L% [3 H3 P8 ]- l1 m1 w' i
Page 2 of 5; k4 h0 Q. G# S2 |& y
b) Print out to the screen all the lines of code that are the same. q% P1 C7 Q8 d* W% u% R1 k
 Include the name of the file and the line number of the code being printed for each of the two files' m& T/ `( ~- }) j3 @$ p
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared5 S" L! ?* M. @# ]: l1 ~
 the name, username and department of the user, }* j- ]3 g# R1 R
 the statistics of the comparison! g* {6 K V: g! j, Q
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
+ |3 e' ?8 j: H1 n the recommendation for further checking
( U O# [7 W# _+ Z( C; w- 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
, ]3 D$ W" {& F0 @1 b/ ?. C the names of the two files compared
& H! ]9 X* u; U+ ld) Leave the program (exit)# a/ }% h+ I8 t: r# p+ E
The ProgramCompare class: (Total maximum 20 marks available)
. L# _# k9 Q" a9 R2. 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)
; Q: s, |5 Q1 P6 k- Ta) provide an error message if the files are not found or there is a problem opening them5 G+ j( `% b3 s/ q" u: o
b) compare each line of code8 N" [3 z4 K! L% ?+ f9 R
c) print out the lines that are the same
! P2 X0 m! E4 Q6 T9 d6 Bd) count the number of lines compared / lines the same( F$ ~7 x% |5 |
The AuthorisedUsers class: (Total maximum 20 marks available)
& Y' h+ W, r1 j: s0 u4 y, q" h3. 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)) M/ F! r4 \5 j) y: A& _5 t2 {: s
4. Provide methods to:
6 c" c, V c8 S# B) F Ra) 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. I* h3 }% E0 K" t
b) return the name of the authorised user
* I* \ C$ G, N9 {' b# d( w4 Yc) return the name of the department of the authorised user
4 s9 U4 W4 c7 E: T4 I" f( {Individual Data (Maximum 20 marks available)
# Z8 q+ _4 A. l4 u5. 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.
8 h( g4 {# A7 r3 G/ dDocumentation (Maximum 10 marks available)
) z! t- C- w6 M U2 P) k9 V6. 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.
- Z q6 d( l: |) [0 KBSA104 Business Programming – 2007: Assignment 2
9 g: V2 _! {+ l& H( _- ]Page 3 of 5 |
|