|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
! N) Z; e! Z9 m7 j/ [3 I% MShanghai - 20074 z" q. R" `9 F a3 B2 ?
Assignment 2
" a4 U; {2 d& v% G$ C, n5 NDeadline 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)2 P8 J1 P6 Q8 e
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.
& h! Y0 H. S% F1 Z& t+ j; e1 b7 uThe staff must be able to:% K8 J# q2 Y2 {1 E# O, H( u' l
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.: _. q5 ~* E( q1 n% G) f. B
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.+ E; Q, H9 ]% M. s
 The interface should provide a menu so that the staff can:
3 w4 O* ^# s8 c# g# X* {a) Enter the names of the two Java program files to be compared
8 i0 d' ?* O/ Q" U7 p5 i For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
F0 W9 I+ u" w+ [0 l6 I** 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).
+ t" Q. h( ?0 b) m* K; yBSA104 Business Programming – 2007: Assignment 2
, H1 P& n' I1 A; s, EPage 2 of 52 N0 I) u, U3 Z8 T6 Q) ]* P
b) Print out to the screen all the lines of code that are the same
a0 L3 U, }7 J; B1 r Include the name of the file and the line number of the code being printed for each of the two files- M+ q: p) v: Q4 R4 ~) S; S! \
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared% b1 m3 N1 Q$ o v. M
 the name, username and department of the user
& `$ |3 P0 n7 ~6 s: B/ N the statistics of the comparison
6 n4 v* U' ^0 h7 T- I# D2 u- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
( O# r; e" Q D4 `7 O& ^. e the recommendation for further checking* L. Y B; F2 L0 o1 i
- 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 closely0 ]# e7 c$ j% f4 z& H
 the names of the two files compared
$ c5 @9 v+ F3 ~; h$ n8 o) Vd) Leave the program (exit)
, ]4 g* i: c; w- n2 x! lThe ProgramCompare class: (Total maximum 20 marks available)
- j( v7 X6 P7 g, f2. 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( G8 O- x2 I3 `# Z
a) provide an error message if the files are not found or there is a problem opening them
, r4 c: J$ U2 l7 Sb) compare each line of code
% Y+ l+ X: H6 s/ f) Nc) print out the lines that are the same' J$ w4 m0 ]5 x G2 |$ r& z" [
d) count the number of lines compared / lines the same w& |, l- W1 ~# ~9 i5 ~) {% p
The AuthorisedUsers class: (Total maximum 20 marks available)% u c' K& J- Y C/ }' o
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)' Q4 z! a2 i8 q% v3 \3 Q
4. Provide methods to:' j" `. j$ Z6 Y1 ^
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
: R" s. q6 h7 r& nb) return the name of the authorised user {$ \+ i( P6 c4 n$ F8 z( X; `4 {
c) return the name of the department of the authorised user
5 m, F! _; r% O1 e6 X: s0 r; `Individual Data (Maximum 20 marks available)
5 A* C9 d. a% N& d: I" i: F; k5. 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.& U! x" i1 V J
Documentation (Maximum 10 marks available)9 Y- h3 t- x, s D- {
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.
0 R0 q6 }9 X/ `8 L4 P3 j, B% BBSA104 Business Programming – 2007: Assignment 2' [2 Y8 }4 W# @. x: X( Q
Page 3 of 5 |
|