|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming
. }+ R0 ?# O; G5 _. lShanghai - 2007; l' k: q- ?! n( [( d. p- q; u
Assignment 2: ]) D& {; [6 A' Z
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)9 d1 ]# V6 D5 `$ g! C
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.) B- S6 c' V+ [' Q! P
The staff must be able to:4 h5 c( \" z8 e: j- B( B6 ^
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
2 A6 O4 ]/ o8 P$ a/ |! d9 g8 p1. 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.
+ c0 u( R/ C0 w The interface should provide a menu so that the staff can:
4 H- S/ C' ^! ]* ?* Na) Enter the names of the two Java program files to be compared
7 s$ _ p) ]' P9 F+ Q/ z' \ For this assignment, it will be assumed that the two Java program files are in the same folder as your program.
1 W# ?% B9 K- @) a$ h( G/ l* G** 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).
5 a" [/ C4 h$ o) m; O0 E0 OBSA104 Business Programming – 2007: Assignment 2- W% c* `3 r+ O5 i8 [" S
Page 2 of 5
3 P% D; T9 z8 r; ?; X# j: P( Y/ U! wb) Print out to the screen all the lines of code that are the same M& x# Y4 P' j5 j2 Z
 Include the name of the file and the line number of the code being printed for each of the two files
2 A; B3 e9 J8 T) G) }' C! h8 C3 m+ ~c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared
3 S1 {; j3 F, Z, k. q- d) Y' o0 U the name, username and department of the user
2 f- z9 C! d9 Q4 g {- d. H! g the statistics of the comparison5 o# i. L: P. f6 p& H3 b
- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
0 t4 v( Q! L& x) N2 e the recommendation for further checking
9 f% n- S, [+ P/ | 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 closely5 G' w* L- T; v% K( P% p* _
 the names of the two files compared
h8 M8 E: \. r3 n3 V y8 nd) Leave the program (exit)8 K7 G3 K* @# n3 R4 j9 _2 I0 r( k
The ProgramCompare class: (Total maximum 20 marks available)
# I$ ] n" [/ f1 R, 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)
f. o2 N* C' r: d) W* f, za) provide an error message if the files are not found or there is a problem opening them
- Q8 H. K4 M$ J, C+ ~- m; `3 C7 {b) compare each line of code
8 A- a4 n4 Z y4 b( q$ Lc) print out the lines that are the same
$ i1 ?6 j" U; c E) hd) count the number of lines compared / lines the same
; u x+ k5 I) sThe AuthorisedUsers class: (Total maximum 20 marks available)3 @1 d8 I* a8 E! ~3 N' \. ^5 U5 W
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). v0 G# O% E! M A3 G# B6 i6 u
4. Provide methods to:5 L% M" t' [0 h
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
/ c! S+ `- S; F8 Fb) return the name of the authorised user
$ \# c; {$ w0 R1 zc) return the name of the department of the authorised user
3 l( O4 C4 \; }" |Individual Data (Maximum 20 marks available)
s1 a- _3 d s, J, w5 E# c5. 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.+ N1 i0 T e4 T, b! z; n# F) W
Documentation (Maximum 10 marks available)
) _$ _; {% t! C E( M. }; C6. 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.5 s" F" T4 E! L1 u% i% [
BSA104 Business Programming – 2007: Assignment 2
3 T' `8 W/ A* e- ~Page 3 of 5 |
|