|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming7 t4 S0 Z8 W5 O5 U% U4 ], @
Shanghai - 20072 G- q2 ~* }, q5 q) i2 l! j
Assignment 2# {$ q8 W& }2 D- j+ S) q8 n7 J$ J3 o' c
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)' U2 ~% M/ h" N6 B+ l" \+ K
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.- ~& Q9 }* j7 s
The staff must be able to:2 u9 t; c% A( i& [8 C- \5 P4 s
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.8 j4 \: D- M7 n- L6 M4 | [+ 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.
9 P) L$ g$ ]. u The interface should provide a menu so that the staff can:1 V9 J" Z, p' e" p: D
a) Enter the names of the two Java program files to be compared
, L8 S" n" p G For this assignment, it will be assumed that the two Java program files are in the same folder as your program." B: ^9 S# {% o; f. @
** 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).
, {# F# A% \! D5 |* W' n4 cBSA104 Business Programming – 2007: Assignment 2
, F; [9 ]4 i2 S3 WPage 2 of 5 Z' l; @7 m( U# U. E
b) Print out to the screen all the lines of code that are the same2 r W! x4 m8 @2 M0 k( U4 c, B9 X
 Include the name of the file and the line number of the code being printed for each of the two files
- @% b" K" P, Z2 c0 \3 k! `c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
/ O% w7 X7 K3 _+ b& z the name, username and department of the user
4 b4 L4 T8 G8 ~4 m the statistics of the comparison
0 l( v- C8 W& `" V d' ^7 `0 b- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
3 X% }' Q7 h% S9 V5 ~' \$ { the recommendation for further checking
) {% C( k4 [+ ?2 [, n7 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 closely7 J( X. ?* E% X1 c. _0 y: t; J) `+ n1 b
 the names of the two files compared/ L! t/ I! A/ p5 U- |# ]
d) Leave the program (exit)
: J# H3 m: k8 G; |: L. }9 DThe ProgramCompare class: (Total maximum 20 marks available)" o% E. e* Z- ]3 {
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)5 b3 V$ _+ F( f# j3 d5 G+ I0 F y
a) provide an error message if the files are not found or there is a problem opening them8 \9 O8 N. r1 W) N
b) compare each line of code2 I, |+ a0 ~: V2 z
c) print out the lines that are the same
& G5 I/ J: C1 o3 ~9 zd) count the number of lines compared / lines the same3 c5 n9 b3 [+ g% J" r! C3 [: j
The AuthorisedUsers class: (Total maximum 20 marks available)
3 M! b; J) Y; {' w# Z g- }5 n8 U3. 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)
* |# A% v) ~9 Y2 W4. Provide methods to:
* B, e" b1 L: c" P+ ]( a' j' 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
* Y; U; C3 |8 y2 B; Vb) return the name of the authorised user: [: t8 j1 f2 K
c) return the name of the department of the authorised user
! k* a0 o/ v5 ?! R bIndividual Data (Maximum 20 marks available)
( D0 F, a6 H6 i9 w7 ?7 w/ W8 ~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.
5 W; T; j) c* h% |9 v c$ u+ qDocumentation (Maximum 10 marks available)8 m( q+ I' A* h$ T) [ o' o& 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.$ h# P# H# T! f0 f
BSA104 Business Programming – 2007: Assignment 2: n: [/ F: L3 c. A+ a
Page 3 of 5 |
|