|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming. P6 Y6 ]% A: w2 r6 i' G3 b
Shanghai - 2007& I& A3 x, S4 W8 Q1 i3 q3 B+ o
Assignment 28 |9 X/ ?" C1 }0 F* }( P$ ?
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)
5 @# d; T8 X- b$ n0 v1. 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.$ X+ m9 u5 _' ^ [
The staff must be able to:2 p! L) }- i9 M; u# F
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
7 ?) E2 k# [$ |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.
( w( `& f$ t& x The interface should provide a menu so that the staff can:' [! J" ?" P7 ?
a) Enter the names of the two Java program files to be compared
/ Q2 _7 J& }9 Z For this assignment, it will be assumed that the two Java program files are in the same folder as your program.9 l7 U) c" O6 e7 C
** 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).+ ?% k5 n2 w5 n0 h
BSA104 Business Programming – 2007: Assignment 2" m6 D( M% C' s
Page 2 of 5
$ {* q" K& ~% U# ^, Rb) Print out to the screen all the lines of code that are the same- W% B- G; L0 f* g/ T# {4 c
 Include the name of the file and the line number of the code being printed for each of the two files
9 `& { b8 z* a1 U$ X/ {: o4 Uc) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
& j% S8 p3 [0 h) k3 o$ Q( s, M the name, username and department of the user# O5 ?9 g3 R6 o; B3 ~& e* Y) e
 the statistics of the comparison; x, B8 s- J. ]8 @
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different0 u0 e0 y+ u7 x) Q; |8 K
 the recommendation for further checking
+ b" p" r1 k8 }3 \/ u: e" s- H% j- 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( L Z& U* Z) w% N; }5 N- Q9 r
 the names of the two files compared$ P, @4 z+ f+ B& X' C* |
d) Leave the program (exit)
2 z4 |! Y7 S5 d8 U5 x7 N( u' t. {The ProgramCompare class: (Total maximum 20 marks available)3 c( X- l" w6 M" E+ b) Q
2. 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): V* |, n' }" @% S& @
a) provide an error message if the files are not found or there is a problem opening them
" e, I; C8 G' E- C; db) compare each line of code
' K2 ?5 {2 z" Q3 f& |' d; i: lc) print out the lines that are the same5 j( t; r( ^# t# [5 D
d) count the number of lines compared / lines the same7 |. u- P7 _& e N2 F+ m7 t" r
The AuthorisedUsers class: (Total maximum 20 marks available)
' R( F; S! a! ? T( t2 I! G3. 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)
+ o2 F8 p5 m5 U$ Z A. ^; M4. Provide methods to:
0 y2 _; u' e+ a u4 za) 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
% ]9 A+ @* q/ A' P& Ib) return the name of the authorised user
3 ^* Z4 p2 g7 X" u+ k" N* n, s* qc) return the name of the department of the authorised user
& R3 i, @" D" h7 x( i! m" fIndividual Data (Maximum 20 marks available)
7 H0 f- U# ]3 c; G0 N8 Y5. 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.9 G F7 G2 ~) s& E
Documentation (Maximum 10 marks available)6 G' l6 S( [8 l
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.: B+ V" @; ^* ]& _" y# S5 _
BSA104 Business Programming – 2007: Assignment 29 H7 }0 Y" Y- W
Page 3 of 5 |
|