|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊8 d, |7 [8 d; O% }
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
( m; G1 d$ t; t r# T! yRequirements: 0 i9 @2 A+ V/ V) T
Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
8 l! I& M& @3 O" n# z. X+ ^% g$ WAssignment 2 page on Vista. + S+ r* Z- E& r- J) t
0 u$ H0 |) `) O f5 z6 Q$ YYou are required to perform the following tasks: 6 ?7 c# E T. i7 v1 W! K3 v3 I5 P
$ l9 H" Z$ C* a7 R, H2 Y
The RepayCalcMenu class: (Total maximum 20 marks available)
9 x& y# p$ D) i4 E" {) l2 h
( C- l( z& N- j7 J: S$ n 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
. y' {( G) x+ E3 ]' N' L Finance Company so that it can be used by the Megalodon staff members to
0 d+ s5 L) r; x' e9 h determine repayment options for their clients.
$ U. U) m1 I/ Y
0 \9 V; _5 J. ]3 { A: W The staff must be able to:
: I% Z" g6 I7 ~4 O0 E" E6 N% M& C: p% ?+ r0 U6 P5 l0 {" [9 |
* Log on to the ‘system’ using their user name and a Personal Identification
5 c6 I [5 q b. N( q7 k/ l! J$ a- t Number (PIN), which a four digit number **.
0 M/ I& N9 g# C. _, R
+ v' s6 M0 J( o' c * The user should not be able to use the ‘system’ until they have provided the
. T' H: H+ ` e% Y( d2 Y. F) N5 ] correct user name and PIN combination. You should give them a second or 7 I0 y$ p1 F6 a; ~ U6 ?. C
third chance to get it right before shutting the ‘system’ down.
% x. s( ^! t) G/ O, F- r" s4 S3 W+ E( y/ J- x* h
& U. r ]9 E K/ u8 c
+ t5 l7 v5 W9 c" G- H( p ** You must use the user names and passwords provided in your individual 5 {4 C- ?8 E% G" X. K* x0 R
6 ~4 M. q4 K. U
data available from the Assignment 2 page on Vista (see requirement 5 below).
# o# [9 M# \7 G4 k6 r) s" I7 {6 w The user names and passwords should be included in your code, and the output 8 n* f' `& \5 |. \
to the screen should prompt the user with the user names and passwords (for * z5 z7 w& f! v5 u1 r
! }4 G6 ~/ Q p$ r4 I$ a" x9 K; @
marking purposes). 3 D+ l0 p: q: T, Q6 Y
7 x5 k! \5 T9 w! d
Y( q7 F: _, _- m. i/ r' W
5 {$ { {: w" \/ ?( F) k* The interface should provide a menu so that the staff can: 0 T# z; }6 Q% q9 C, k
" `1 }" ~# G; {' N( j: K
- Perform a Repayment calculation
$ N9 N; C$ B/ [; A& t% u' {6 C F7 U9 w% N0 O( ^
- Print out to the screen the Repayment details - `4 z$ u# u8 S5 i9 |
2 s; {1 J1 j4 v3 B5 {3 \
- Change one, two, or all of the values for the current calculation
2 ~% p7 y( a* H v2 _4 d
t7 D* g4 ]4 B/ {0 s( P' w$ [ - Start a new calculation ) \$ a; O' E5 R# Q/ E
8 H* I8 G/ Z) S - Leave the program.
3 b( }# o5 g0 Z7 lThe RepayCalc class: (Total maximum 10 marks available) ) r) y. W1 P8 L
9 a4 K- k0 u0 X5 q; p, \/ |# b 2. Provide a method to accept three input values from the user: 7 O) w: [) x1 ]% n( d, ]6 W
8 I* X J5 Q0 ^# m - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
- w5 K" Q# P4 m1 t W
+ I3 W- F* F7 a* E- c+ m - the Annual Interest Rate (to 2 decimal places, for example, 9.75) / v& l, r: q) @+ j4 c
3 W8 x2 b" |$ O1 N7 C - the Period of Repayment (in whole Years, that is, no fractions of a year)
+ A& ^$ `1 ~* K9 P/ c
: T- e+ z& ]6 s" } 3. Provide a method to print out to the screen the three input values (accepted in
, L7 h7 w& b2 S, Q8 U0 @ requirement 2), plus the repayment calculations: , e0 V/ h- D* e) l+ e. Z6 y
' ^+ m, \' h8 `# W; H A
- the Weekly repayments 1 Y9 g, z7 U8 F( Z9 U
) @ h( X! {/ S) Z - the Total repayment amount (Amount borrowed + Interest)
+ ?7 e6 V* l1 \0 f* l5 g# T4 R6 K1 q {3 x) e4 W \( q; _1 v
9 Y' u k( }- w( u' S
2 P9 \- D% g7 k7 i3 p- D$ J
The Borrow class: (Total maximum 40 marks available)
( T) i0 J% @0 }0 x; w9 D$ u% o% }1 Z' m P
4. Provide methods to perform the following tasks: * X+ d$ Z* D% j; g/ W: p% h
( U+ D5 u- R* s( J+ |/ E% k1 _: {
- to calculate the weekly repayments ***
+ o9 }: j3 F/ e+ I1 q& Q' g, g. J0 J% H" L N2 U/ x0 c% R
- to calculate the total repayment amount # f: V/ C' R" e* i
# I8 U! w" K- G% J1 H _! a
- to return the amount borrowed
6 Q( T( a( B/ P# f l
6 K- {2 z- ^4 n8 X( n; L3 R - to return the borrowing period in years
' s4 \9 T- p: Y5 Z f3 }+ f+ k% c3 ~ J
- to return the borrowing period in weeks
% n9 W& Z; b; A) {7 }; N1 t$ r6 e
: Y6 s0 u2 c8 U2 B - to return the annual interest rate 9 f% y) m1 J4 j0 O1 E
! v4 S/ r4 s! J7 q - to return the weekly repayments
! i D# g2 N! \3 l' \5 d/ [0 ]: N# U/ H1 k* \8 H0 s8 e2 Y3 R
- to return the total repayment amount : X w0 v8 ^" F* r6 V) h2 R) C
# _* b6 v4 W3 ^
- to reset the loan amount ( x( O1 T# f9 \! c5 P
1 K2 P$ P9 Q) r& c( [
- to reset the annual interest rate
- W3 f# ^- z! ~: i" W+ a
N/ R' x* m2 d) r5 i - to reset the loan period (in years)
$ h X8 b- y% y
4 Z- y a* ~6 n Z3 U4 b
: q6 n# j$ t# E4 o- R' j2 K! k; C, E+ w0 ]. O- D: n$ v) E2 i7 o3 G+ H" t
; e& x7 A( ~) _9 w. j, H% t
2 t: Y/ J5 q3 T) I5 j6 `9 f
*** Use a simple interest calculation (not compound) formula, for example: 4 S. G. Z* N6 I% a% B
% R+ y1 |) i0 }1 Z/ D( p" C weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * : n. s1 J/ z6 @! l. \* N- U
numberOfYears )) / numberOfPayments; 9 M( Q8 N. A I
1 r0 L, G1 v5 _3 `+ D+ G! m% P
2 ]* g! ^1 S) q& h* B/ x
9 T. u( y* p- B# J1 A7 U1 V
* h# E5 R7 e9 `; Z$ B
' A9 K' T/ }- I% sIndividual Data (Maximum 10 marks available)
; L1 ]7 n, P' n N
1 C+ K: L) e0 P 5. You will be given two Megalodon staff member user names and passwords, plus a set
3 X/ T' h2 p) p S$ N of data for each staff member to use to calculate repayment details. You will need to
* c7 F7 w: S3 C: s7 q6 b) H log onto the BSA104 Assignment 2 page on Vista to generate your individual data
* V; O+ ]" s+ g( T and instructions for this requirement. You will need to use your University of 5 ]0 ] Y7 j [, c
Tasmania (UTas) student number. 0 V& E. j$ `8 S; X7 t, o) H. j
6 o* D5 {& i# R7 |7 ]; g. }' n
( L5 }3 ~" h+ F- t" F- H* G Page 2 of 5
: g; _' p% C: t$ @5 S8 X) R
7 K& M# Q7 @9 kFor requirement 5 use the following data:, s$ j4 r5 {, u4 |5 U( w
4 r! t" ~( g2 o, X! x; c
# Data Set 1:
& o2 N( a2 g3 W8 i1 @
0 M* V5 M. X" U- I9 ?. R2 @- VUser name: JordanM7 E$ E8 V" ?2 J& Z5 a; w0 O
Password: Ferrari
: M; Z! u D+ t3 E4 X6 s- xBorrowed: $ 749.95! Y8 B- D7 }# L
Interest: 15.0 %
- ]/ P; C7 P+ O+ ?9 ]Years: 4
( E, _' f- J7 {: |
4 _$ H( I8 H# I# }5 g9 t, H# Data Set 2:8 k; ?; O& ^9 s$ H$ I
% v3 Z" v7 h. I6 s, kUser name: KimZ4 k( a" C' `+ L) q+ ^/ j
Password: DimSim
7 k/ @- y0 k! D+ l6 OBorrowed: $ 150500.25
" `8 h/ h- e3 \Interest: 5.5 %
) M( c8 k! ]# H' N6 HYears: 7
8 m9 J# _$ G, y' @
3 f$ `9 W ?# B2 _! _% c, [8 c- j* f[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|