|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. v9 I p- Q1 v* W
Shanghai - 2007
/ g" _0 T7 c1 m7 c( b! X UAssignment 2" ~- p2 [1 g; r! n4 z3 B+ z$ i
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)
; d3 w" j5 }/ `. \) B* X7 i- U1. 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.
4 U2 A7 D" i% L0 C/ OThe staff must be able to:
9 |8 Y5 E- C1 }% k5 U+ z Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
+ O4 z5 J0 I: m1 E: o, {1 |1 }. 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 i z. \9 \4 N/ f& x The interface should provide a menu so that the staff can:. @9 a( o+ J, H% A
a) Enter the names of the two Java program files to be compared
# O" _1 S/ e4 U9 p8 b4 Z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
$ w" d. B n6 b4 O8 M** 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).
& D2 Q1 p( P+ rBSA104 Business Programming – 2007: Assignment 2
9 K4 z/ _. Q" e9 k3 RPage 2 of 5
3 |3 D- \$ h0 e. ~b) Print out to the screen all the lines of code that are the same1 y/ x2 K$ m/ o* V
 Include the name of the file and the line number of the code being printed for each of the two files
# i9 P+ ^7 ], ]- l$ Tc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
* \2 L# `4 c, i4 E: b& U the name, username and department of the user0 U) q6 j- _& a) d: w# Q& x
 the statistics of the comparison
% o7 |# z) I; i- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
; I& M; f5 P1 z* n the recommendation for further checking7 S0 ?' Q; E8 ~9 j, O& V
- 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; X% S; Q8 ]; G0 b, ?
 the names of the two files compared
$ Q* `, b7 p0 i( Q( _9 Ad) Leave the program (exit)
4 U8 \0 W& u+ y {; B# XThe ProgramCompare class: (Total maximum 20 marks available)
# K+ e- n& ~+ e2. 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)1 D* C5 T: W. q0 m! H1 l
a) provide an error message if the files are not found or there is a problem opening them% Y2 d$ \2 @, q2 k2 c
b) compare each line of code
% S+ S: g1 ?. xc) print out the lines that are the same
x( [$ i8 p( w% ~4 b5 Qd) count the number of lines compared / lines the same, R# Z/ o: y8 V) p& L9 q9 d; ~0 J/ r
The AuthorisedUsers class: (Total maximum 20 marks available)* }: v* R, O% K( w7 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)6 H6 t. e; v- U0 o
4. Provide methods to:! K& M' T" j# j: V' T" o! B& Q7 O0 |5 B
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
( w* W" c: b ]$ j+ ~( D4 |b) return the name of the authorised user. a2 R6 Q |7 |" S% d$ w
c) return the name of the department of the authorised user- o& J2 U! J& k. r
Individual Data (Maximum 20 marks available)0 j* P. s# f; _9 c( G& N
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.
% B' S/ h0 g+ U/ {- v D+ xDocumentation (Maximum 10 marks available)/ V7 ^; ?) L& 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.8 Q3 l3 b* w; {1 y& ~
BSA104 Business Programming – 2007: Assignment 2' `+ T2 u' {- ?6 J+ @; P& V
Page 3 of 5 |
|