|  | 
 
 
| 
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊 ' a! e3 L4 O6 v' d有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
 * ]. u' l& A; F5 k) v  l4 O# Q, a8 h) fRequirements:
 8 u. `# f6 x! K' h: u4 h2 {Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
 # S+ w( Y; l4 oAssignment 2 page on Vista.  . v2 y+ ~5 [; H2 d6 x; L" y& }
 ! Q6 d' x; ]* ~
 You are required to perform the following tasks:  : f5 s: B' U9 R3 b1 f
 
 & C( `3 L9 d% }+ kThe RepayCalcMenu class: (Total maximum 20 marks available)  1 I' B+ A: z  [& _, a
 
 * n# o' Z5 W8 `' {; T- g      1.   Provide a basic text-based interface to a Repayment Calculator for the Megalodon
 ( w& O% i5 D7 Z' M           Finance Company so that it can be used by the Megalodon staff members to
 7 b9 [( S/ F0 R+ r" N' A; D           determine repayment options for their clients.  $ a+ F- |# t1 w6 i
 " L% z' g/ ^% T, _
 The staff must be able to:  & H& |( W) q  p- K$ h
 ( |  h, H  Z/ Q; T5 k2 X
 *    Log on to the ‘system’ using their user name and a Personal Identification  ! T9 N$ d: U& v5 E( ^. _
 Number (PIN), which a four digit number **.   8 q5 x. h' ?$ f, Y" |
 
 " n1 \' T1 P! \/ \4 G2 D' C                   *    The user should not be able to use the ‘system’ until they have provided the
 : G' o3 e( `) y2 x                        correct user name and PIN combination. You should give them a second or
 5 c/ b  j0 T8 I& @+ I4 L0 d' S: J                        third chance to get it right before shutting the ‘system’ down.   / ?; i4 h& j; `
 2 v" _  p6 \) N7 B5 p
 7 h: o/ l: h/ B* i
 * G* X8 M6 r+ S7 U& j
 ** You must use the user names and passwords provided in your individual
 - y# i: Q$ P7 u$ {; `( L& n) U6 o% [0 }0 X' ^6 Y% S8 d! Y# Y% o
 data available from the Assignment 2 page on Vista (see requirement 5 below).  8 O3 S, s2 v2 e! b6 l- c3 y
 The user names and passwords should be included in your code, and the output  ' t" n% U# q) s9 i# G( z6 B$ [
 to the screen should prompt the user with the user names and passwords (for  0 s, _7 O/ j& h: U! U  s
 9 f( b1 A/ H! U5 p: N
 marking purposes).
 * R# o/ W' a6 W4 Z6 E3 {8 E! T5 }; s) C. |" B* o
 
 ' I5 m$ e4 ^8 n
 " q0 `5 F6 }' ^$ a0 s+ b*    The interface should provide a menu so that the staff can:
 1 l7 X1 k1 J; _* k, D
 + ?! y( ?6 |( I" ?- G                -    Perform a Repayment calculation  ' C0 P* f% _5 `; D( m0 j+ j/ j+ S$ L* J" `
 
 + {- @% x" o0 R! ^                -    Print out to the screen the Repayment details
 - `5 s3 d. s6 }" _- `; ^
 0 d$ H! V" G) R: y; n) h2 O: r6 u                -     Change one, two, or all of the values for the current calculation
 & E: [* e  _; x# y/ ]6 g
 0 N8 V; R9 U0 }; g1 ^* v                -     Start a new calculation
 3 l& _# g4 p/ G$ a% I+ K" l9 ?8 A
 1 y5 b* {& _3 }) W2 ^. K2 Q                -    Leave the program.
 ) ~$ _& n, F4 F8 K4 EThe RepayCalc class: (Total maximum 10 marks available)  . M5 y. d' ?( l- r( Z  z2 p
 
 / u& v0 O: H- Z$ Z! Z; w5 a7 `     2.    Provide a method to accept three input values from the user:
 2 M3 H$ x' D9 n: E, ]& e) L5 o
 2 i+ T4 Q# Y3 Q7 Q                -     the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
 " U/ b3 V) \) n6 A4 B" ?. e8 Y& a8 H5 Z
 -     the Annual Interest Rate (to 2 decimal places, for example, 9.75)  : A* n; \' _" d8 J* W9 A, j
 
 5 p/ M: `2 S/ k5 I) T+ b                -     the Period of Repayment (in whole Years, that is, no fractions of a year)
 4 |! d2 \, U* n4 }+ @) u" K  b- ~1 X9 k& X1 @  T$ O, j
 3.   Provide a method to print out to the screen the three input values (accepted in  ! h/ [2 j; Q2 e; K6 L
 requirement 2), plus the repayment calculations:
 / {0 F/ Y" L" X2 r( S2 P. z) d9 M; x: v) g: l% W9 X; w
 -     the Weekly repayments  ( S) S; Y7 o( P9 `
 
 ' _2 K" Y$ K% ?& ^/ O                -     the Total repayment amount (Amount borrowed + Interest)  ) G2 [# Q6 F; L% E0 V
 & {, b- Q$ h( a! c9 h, S
 ; S9 |/ U2 R  S
 - R7 J" N$ `; Z1 s1 R0 l6 E
 The Borrow class: (Total maximum 40 marks available)   * M# b' d) n1 l& ?
 
 \" N7 s* D3 \: r     4.    Provide methods to perform the following tasks:  6 `- u$ ~1 Q8 i( F  T* u
 
 ; b  @9 L8 p/ p  ?' u! n; T                -     to calculate the weekly repayments ***  ) t7 o' H0 q+ b, P; Z* S
 
 6 a. r" \8 x8 T, K$ @/ K" W0 }                -     to calculate the total repayment amount
 5 R! e6 F3 n& G: r  I  ?& t( T) F  N, U9 f2 P  Z1 C7 F
 -     to return the amount borrowed  * f) }( d6 p( Z5 k* w
 U6 c. I* N4 S6 L
 -     to return the borrowing period in years  ! U, q& z7 S2 c) b
 ! n+ m5 b( c: W, L6 ]- h2 s2 _
 -     to return the borrowing period in weeks
 & J- p5 Q6 I: j+ h4 B- R# m) V  G
 P6 V# g( @  W, S2 Z/ Y4 |                -     to return the annual interest rate
 2 l( [8 O7 I3 ~7 r6 m% a1 C
 ; l& ^% Q2 }: ?$ A* `8 H5 t& D' \" O/ O                -     to return the weekly repayments  " k. s9 F% h- R5 h1 ~
 : o" u& l2 n; ?0 C5 f* ~" u; a
 -     to return the total repayment amount   . i' ]: D! \, l$ N
 
 / r; a  z" j. G! Z                -     to reset the loan amount
 3 H) Q: l. }2 f" M: k+ J
 + L$ \0 A3 f* Z3 m2 N                -     to reset the annual interest rate  & a  ?$ \6 g. i+ z
 
 $ v+ I+ @* Z: `" Z9 ?                -     to reset the loan period (in years)   # x  I( y0 j8 x. S
 
 & z* H, e$ X5 R2 B$ ^) u9 c; {/ C4 j       3 M0 Q! r( s$ t' ?% T7 J) |
 
 ( \0 u+ _" X* p1 ?$ `* a& V. F
 4 f1 X: m  R& m0 y; d# a1 ?       $ m9 S/ N: q4 p1 T$ A! F
 *** Use a simple interest calculation (not compound) formula, for example:
 , I4 ~! |7 l, m0 i- Y- z1 X, F) X       6 f9 X" K1 w3 ~1 B- D
 weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
 * @9 n8 x0 F" d' [( ?             numberOfYears )) / numberOfPayments;
 8 S& e( m7 |9 l) [' f* W! ]7 Z) B. \! r8 Q6 R
 
 8 J6 i( y' c/ b
 6 G; C" z. s9 \- X/ ?       3 K' |) k5 Y( ^! u& F7 w/ ^( w' h
 , X; L) _9 p; Z8 X$ U4 s& n
 Individual Data (Maximum 10 marks available)  * o& D+ R  }+ K2 t8 u& L) ]+ V
 $ U& {$ G. z! h. F" n/ G$ A0 }, ?
 5.   You will be given two Megalodon staff member user names and passwords, plus a set
 " s5 n/ x$ r8 m# J5 L) p7 b; V           of data for each staff member to use to calculate repayment details. You will need to  ! X+ @8 z/ G' A; E: t
 log onto the BSA104 Assignment 2 page on Vista to generate your individual data  + l6 N7 p1 b( a
 and instructions for this requirement. You will need to use your University of  7 C1 r- _* b0 V9 t7 h3 X( ^
 Tasmania (UTas) student number.  . m$ e/ K) [) V1 l0 R4 W
 
 2 d2 H1 m+ e) g8 K! J# p. }) y# J3 I  M6 {; f
 Page 2 of 5
 5 o7 W; O3 G8 Q
 3 t/ W" ]1 s* }' s% z( QFor requirement 5 use the following data:2 S: J$ Z7 \6 x
 9 }& L4 R2 V- P
 # Data Set 1:# U: }, u% n4 i! U
 
 0 j, ~/ o+ X' v+ Q2 tUser name: JordanM
 1 ?" d/ P6 h# S) n3 ^1 IPassword:  Ferrari8 F; v! k# K0 {; w5 U% d: k. r
 Borrowed: $ 749.95; G2 `/ C9 X# u3 \2 G7 N
 Interest:    15.0 %( H& W3 a8 h" O/ @! V9 g6 F) x
 Years:      4$ q$ g/ ]2 j' Y8 r% [1 p/ M0 s1 |
 
 7 U% y/ V0 q! R" {. w) }0 @2 n" m) C2 w# Data Set 2:: }: Y; L8 J& ?2 j: K
 - S5 G" R3 a# S- e1 m; E- c& Z7 d5 [( a2 L
 User name: KimZ
 6 x" c1 H2 g) J8 Y  @  H7 U8 y- ~Password:  DimSim" E* |. L% }* P2 i
 Borrowed: $ 150500.25
 . D) k- w2 B( L9 J1 E3 hInterest:    5.5 %6 U' c8 ]5 B! f& }3 d" w/ V6 n
 Years:      7
 1 M; i$ A- l$ ]5 V. D2 W# M+ W8 z
 / G, }" i8 O6 R[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ]
 | 
 |