|
|
楼主 |
发表于 2007-5-9 14:03:32
|
显示全部楼层
BSA104 Business Programming# X8 I+ g) P% K' q8 Z/ x- J
Shanghai - 20079 B0 u* t+ }( j$ i+ Y* G& ^% y) U: S+ j0 G
Assignment 2
8 f+ E- w: ^/ c4 tDeadline 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)% |2 G$ r' `+ B
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.
$ I m" R. I0 Z, ^The staff must be able to:; t- V' Y# ]9 s/ |/ Y
 Log on to the „system‟ using their user name, and a Personal Identification Number (PIN) which is a four digit number **.
; i0 I, I0 T9 x4 q1 _# D1. 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.# P/ o8 W0 \' }: k# Q5 U
 The interface should provide a menu so that the staff can:
9 v* \3 ~3 `0 k; Ja) Enter the names of the two Java program files to be compared. [" q3 ?- K" f# b0 v
 For this assignment, it will be assumed that the two Java program files are in the same folder as your program.5 I, z& L! G# V( V
** 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).$ M5 o& R9 G- x
BSA104 Business Programming – 2007: Assignment 2, [4 I# t" w+ V
Page 2 of 5
4 Z0 U" o! u7 ]8 m. Y `b) Print out to the screen all the lines of code that are the same. I$ c4 C) X- L8 \/ @
 Include the name of the file and the line number of the code being printed for each of the two files) b8 Z; ]/ j& i1 W: d& t/ F n
c) Print out to the screen all the available information regarding the evaluation of the two Java program files being compared2 T" C; }& ?* |! z. q& ~
 the name, username and department of the user& M. Z, D9 S" j. }1 f5 m
 the statistics of the comparison
& d0 M8 w8 Z# A/ d% t- For example: the number of lines of code checked, the number of lines the same, the number of lines that are different
7 i3 |; H. C1 ]/ r the recommendation for further checking4 E( x8 q# w& ~/ L/ U6 Z* g7 e" W! {6 W
- 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
. T4 U* h0 K/ J0 U the names of the two files compared+ @7 R3 b+ S P0 r y7 v c
d) Leave the program (exit): K0 @5 ] ~- P t9 w2 w) D
The ProgramCompare class: (Total maximum 20 marks available)9 B4 g- `7 L, u/ g
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): q6 G1 W+ ^0 x5 Y
a) provide an error message if the files are not found or there is a problem opening them1 F; ]8 [3 C; D9 D% }2 H4 W! h, [
b) compare each line of code0 {. ?3 |3 X9 b. G. A" V
c) print out the lines that are the same9 k; W c* P9 ?7 y4 b
d) count the number of lines compared / lines the same1 D) w6 s: b; q2 D# u
The AuthorisedUsers class: (Total maximum 20 marks available), a6 {' H2 o4 }; _. P$ D+ M
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)
8 q& U( o+ D9 O' N& v6 Y1 X% R4 T2 r4. Provide methods to:
. q- [2 _( J% }5 y# C2 V5 G1 E, |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
- K6 h6 |0 u. s7 _; b9 db) return the name of the authorised user
: v+ {2 n9 ^( U% s3 I1 k1 z% dc) return the name of the department of the authorised user
9 ]4 k( x4 ^1 Z- iIndividual Data (Maximum 20 marks available)
5 ^# n8 v! c5 ]/ m- J3 w5. 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.- v/ I* a3 w8 q. F/ C
Documentation (Maximum 10 marks available)
- ?7 l( k& T; [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.
. S8 T, I4 m+ l) B+ V& h' qBSA104 Business Programming – 2007: Assignment 2
3 a+ O/ A1 V/ yPage 3 of 5 |
|