|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming/ G; N9 A& m' @: x$ b7 I
Shanghai - 2007: ~* u) s: R1 z9 D: _4 A
Assignment 2% ~' K0 a. Q/ C' a/ V: @" I5 ], i9 \
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 W+ }* o6 m2 n/ a* \! {' c) a1. 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.& o6 V2 w7 L; g. {* r
The staff must be able to:& B, p% @$ p4 B- a% k( p5 p( D1 G
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
, `7 I5 ?4 O+ L1. 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.+ {0 `" m: B; u2 Y- n3 e6 H
 The interface should provide a menu so that the staff can:
5 t( _- D9 R. B0 J/ }7 `$ N4 m+ k* ia) Enter the names of the two Java program files to be compared
5 x9 E- V1 W# d. ?- \1 |7 c9 V( l For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
5 V( y' e j1 c3 E( Z4 j6 K** 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).8 `4 q: n n# _6 q8 H/ y
BSA104 Business Programming – 2007: Assignment 26 e; N' t8 S# b3 y2 S! d# [
Page 2 of 5
. K: Z5 l( U1 B( a+ m# C! K+ vb) Print out to the screen all the lines of code that are the same# p+ w) ^0 F! v- n2 C
 Include the name of the file and the line number of the code being printed for each of the two files
9 }9 b9 L. ?# B% pc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
4 V- m+ | H* m8 O) a9 D7 L0 ~ the name, username and department of the user6 q. S+ j6 B6 p2 z7 S0 A& I
 the statistics of the comparison$ \/ f& F+ D" v. L" m: U
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
9 v4 h1 c5 W& y: M9 Z0 J7 Y the recommendation for further checking, N, K+ q u6 Q) P+ n+ n: L6 [+ N
- 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: [; |" w+ m" @; @8 {. _+ u
 the names of the two files compared
9 W' F a! y( {: b' W( _d) Leave the program (exit)
/ A! Z8 C% `7 AThe ProgramCompare class: (Total maximum 20 marks available)
. i ^* o* U, L3 Y2. 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)' ~ p2 O# L* R7 z
a) provide an error message if the files are not found or there is a problem opening them& W8 ~8 o9 U0 H, L8 I0 S, z3 C
b) compare each line of code
+ X ]3 g2 g" ^, V) Ec) print out the lines that are the same5 U- z% J* V- {9 d: O) }
d) count the number of lines compared / lines the same
j2 o' P. V2 f+ X+ \0 L6 QThe AuthorisedUsers class: (Total maximum 20 marks available)# Z+ X, Y* n7 _ g8 i
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 K: ^2 d& B' P6 a2 s2 G- N0 ]
4. Provide methods to:7 l( e& z0 ?. v& H4 F e% [6 O+ n
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
u5 H" H B, s( Z5 Tb) return the name of the authorised user, [3 f: U7 \) n7 g' g8 a; b
c) return the name of the department of the authorised user/ |. D) z. y- w
Individual Data (Maximum 20 marks available)0 F8 X" `9 J8 `& A4 [! z+ S# Z
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.. f, f# y1 Q% ~$ m0 h4 P
Documentation (Maximum 10 marks available)
9 I) z( l; _6 z4 V8 m' g6. 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.7 m0 m7 X! X! G$ B" ]: B
BSA104 Business Programming – 2007: Assignment 2" p% @, ^( Y9 h! t' B8 h3 i h
Page 3 of 5 |
|