|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
; X/ a/ k1 B% uShanghai - 2007 q+ `7 C! T# i3 R2 y2 }
Assignment 2; S+ h- s3 V) u. r4 m0 y" g& 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)
4 c) j, Q D' ^. F' g1. 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.
% ? D4 h- k* j' W- C6 J: f, UThe staff must be able to:
8 J E G& J6 {% J0 F! P; | Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
8 T: ?$ S3 O* k0 V# B% N( J1. 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.
1 h0 d9 U! o5 E+ n2 V2 n. y' | The interface should provide a menu so that the staff can:
: n1 Q8 E( g) x( z( q$ \5 Q% f8 k! fa) Enter the names of the two Java program files to be compared
$ }+ _) P* e: l: F* b7 D For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
9 E- C1 K9 [# R; 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).
' h. N# A( Y4 y+ E" pBSA104 Business Programming – 2007: Assignment 2
' Y w$ e0 o5 F5 \0 M A4 cPage 2 of 5# u( _" B* a9 j: x9 @; G0 o
b) Print out to the screen all the lines of code that are the same7 [' I3 P7 U. [) P+ b# y7 K/ T
 Include the name of the file and the line number of the code being printed for each of the two files
: ]/ v; ~9 _. q8 n; v; w4 l2 nc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
3 O" R1 r% |$ p the name, username and department of the user
. M1 G3 P2 ~3 X( E1 F9 M, C the statistics of the comparison+ J; N5 D& J/ f3 }% A
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different& [& q0 f+ g- c7 j3 K& b) z/ r
 the recommendation for further checking
+ K; P+ l2 G- p& P z% }- 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% S, u& w' z( O# |+ k: w7 f
 the names of the two files compared
1 C3 S# C8 q) rd) Leave the program (exit)
* Q8 U" v" |7 V4 A* n% [1 q* EThe ProgramCompare class: (Total maximum 20 marks available)
! m# w2 N5 G6 H1 V$ p) h2. 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)
9 P5 ^; }7 z6 I1 X. |* T) Y, `a) provide an error message if the files are not found or there is a problem opening them
: Q: X9 w. X. @" ]( I" ]; l0 [b) compare each line of code
) E7 _1 C2 R7 z" e& M/ r8 ac) print out the lines that are the same
% a* m8 }, h4 t. r' Gd) count the number of lines compared / lines the same. ?6 \* O5 l: C& i* D/ z, H0 P
The AuthorisedUsers class: (Total maximum 20 marks available)
! O. s3 b& e4 N ~2 {2 t3. 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); `# I8 g/ d: d: @6 ]$ c
4. Provide methods to:* n! n( g R& i* u1 ^6 A
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
! S8 A& x! J( A1 Z" jb) return the name of the authorised user2 M& Y/ S; M2 C, j5 q, ^
c) return the name of the department of the authorised user
% M. I& L7 v7 EIndividual Data (Maximum 20 marks available)' ?+ f5 l2 n3 V' R7 J. Y
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.
( o( @, P5 C# W- Z+ v# uDocumentation (Maximum 10 marks available)% I; e$ h" n# f, {: O/ g/ `
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.
a3 D/ R3 T0 DBSA104 Business Programming – 2007: Assignment 2
2 f* ~$ M7 [$ ~$ NPage 3 of 5 |
|