|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊
- e; f% O3 E. l8 {: l有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦9 b4 |) v% O* B' e& M% C
Requirements: 6 E' V! i! K0 I& B, e, j7 I% ]
Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
4 [/ F: R" b Q& I0 jAssignment 2 page on Vista. 6 X8 S1 M& @' t$ G! b# x) D
& `7 r6 q2 K G3 m) R6 I+ `2 }3 [. ]You are required to perform the following tasks:
: S2 ]1 _4 r7 i2 p # ^/ j) ~" x. W/ N- b
The RepayCalcMenu class: (Total maximum 20 marks available)
6 [% |* N8 D" F6 w5 j8 x. |5 T, g
# s* W, `9 M+ V" v 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
# \9 t3 n+ j9 ^% X Finance Company so that it can be used by the Megalodon staff members to $ K# ?# I! b' }; M! a1 f& B
determine repayment options for their clients. 4 O0 e9 x0 c9 x
, b5 S% T6 s& t9 D+ Q The staff must be able to: : }1 j0 z/ k$ F$ \& q2 k
( K/ {! Y! M j2 f * Log on to the ‘system’ using their user name and a Personal Identification
9 z: Q. P& X1 w' O a* T1 e Number (PIN), which a four digit number **.
) E9 w3 @1 }/ G( S$ |+ D
, p8 f2 @* `* m * The user should not be able to use the ‘system’ until they have provided the
0 e& [8 o$ P- v4 q5 ?! S; A5 n correct user name and PIN combination. You should give them a second or
7 y7 s3 W% U9 F1 }5 L; I" R* A third chance to get it right before shutting the ‘system’ down.
' ~9 w4 ~) X' m) |! F1 R+ j5 x) T; i8 A
3 l' g T% w& R0 s! M6 G: e6 \+ i
5 b) \' j$ O( i P: Y! I6 |: }2 y Q; L ** You must use the user names and passwords provided in your individual
2 f6 g! x) ?5 O/ F+ S+ v- h, N& ?; v1 J5 N
data available from the Assignment 2 page on Vista (see requirement 5 below). , Q9 A. g* a9 Z: P0 v) Z8 v
The user names and passwords should be included in your code, and the output
" H" V+ ?* t9 P/ I to the screen should prompt the user with the user names and passwords (for
h) k# M6 i7 @3 L# {/ a7 e
) p1 X% _* l( |2 l1 M marking purposes). * C# @, z- U, n- P) Y
4 T5 V9 {0 M' P v$ S" a
! C: y7 ^9 l4 q) ?6 |# ~
& Y; m# @- L( d/ f, y* The interface should provide a menu so that the staff can: ( f0 n8 K+ s) _: z- M$ Q/ c( _
. D+ ~4 g2 F5 S. I" ]( I+ U* Y - Perform a Repayment calculation
9 D# D% N! W- k& s6 V4 k, R$ e1 f0 `$ r, d- k" x
- Print out to the screen the Repayment details
# B7 Q/ V, l, A: G2 D% _+ u& i, }
0 q+ d Y: r) l& W6 t9 V - Change one, two, or all of the values for the current calculation
. b ]4 w/ Y. n! }2 D w" [1 s! c& b$ G7 w
- Start a new calculation
- K7 Q) I ]* T- D/ @4 d! M+ S: v3 E. I" j6 f8 }7 m
- Leave the program. + p. j5 T$ w8 N
The RepayCalc class: (Total maximum 10 marks available)
8 X( t0 f4 `' k# j& h7 k( W6 A" C4 J$ E) [$ J6 _! }! v7 Y
2. Provide a method to accept three input values from the user: 0 y# S* P ^ [
, S' b+ x- O8 e- D+ [
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) ( r" ?% ?- @8 e7 [5 n; C
/ [5 N% y& j4 Z3 T5 } - the Annual Interest Rate (to 2 decimal places, for example, 9.75) # N/ m4 R1 \8 g0 l. Y
! }3 n% S- f7 r
- the Period of Repayment (in whole Years, that is, no fractions of a year)
; u" O1 c% o/ H" F, l' N! S5 b2 R7 I) c3 y7 O
3. Provide a method to print out to the screen the three input values (accepted in
' F5 j# Y; W" V7 @$ @3 F- t requirement 2), plus the repayment calculations: 5 G" w, i1 x3 s& b& T1 V, r5 t
2 f; U8 E. R: f7 n# ~ - the Weekly repayments ' T; g( o1 f0 n, q8 j! v6 k" v7 l/ ?
& n9 p8 R! E' X; \/ e! M
- the Total repayment amount (Amount borrowed + Interest) I1 j4 q7 l h' k% k; C/ ]
6 I9 e; P* j9 a) b/ ?4 P% g
# s4 k% K# A+ X
+ Y6 R9 D4 ?! B7 m: j) H- f* ?The Borrow class: (Total maximum 40 marks available) 5 l( F0 u' C- n4 \9 u# o
+ a u) c8 k: O9 J+ @ 4. Provide methods to perform the following tasks:
& Z1 D( ^6 F" m1 j/ r- ]3 ?5 q- ~; h/ L) Q* ~, K0 C/ Q( `7 k. K
- to calculate the weekly repayments ***
0 N2 ^6 \1 e H x* ?- k
/ Y% \' T/ c! B - to calculate the total repayment amount & n* z. z3 C( p
. P* i3 G/ S6 A" K+ u+ v - to return the amount borrowed / r! Z: h1 t; p" {
% n9 G s P, W7 c" {5 a3 N
- to return the borrowing period in years % e* E T0 e# ]% c1 H S" F- j( w
2 ?6 N0 |, ^" V/ F - to return the borrowing period in weeks
3 m6 d! H; j: s& D3 [# D; q
* p) v* v! V! F: c1 s" Z7 V - to return the annual interest rate
) o4 K3 E8 x1 I I. y- j) B+ [) r6 k! c+ S& [3 Y
- to return the weekly repayments
" d0 R9 _' C! M' ~: [# l
! A$ g$ N% ^& q - to return the total repayment amount 9 P2 [/ s/ d9 |/ F9 |. @
M& Z9 K! E+ H, a! X1 H
- to reset the loan amount / Y) h z% x, {
! K2 f" ~% W( ]5 F - to reset the annual interest rate 6 h5 E% [3 g4 B; \' _& L& w2 V9 ]
; S3 G" w( N6 T - to reset the loan period (in years)
/ r' x' K |+ y5 j5 s6 B5 D* B3 ]1 \2 j, H4 Q/ a6 [
" L7 m" v3 l- o8 ?5 n" u+ z) R+ Q, C. j- p3 k3 U& E
& c+ ~( W8 z. |: D! L
+ E' c G. w: I; ^! F6 i" Z ?
*** Use a simple interest calculation (not compound) formula, for example:
2 b; X) k5 j5 d
( _) c: @4 t% o( I4 K) x+ V6 G u weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * ! y/ A+ {% K8 i. l0 b4 W2 f
numberOfYears )) / numberOfPayments; * F# C9 w/ K" e" K$ t/ {+ f9 s
: j' n2 ~7 W' v! a- F: i 6 |8 c' g G; N& r3 m4 t7 K
# _$ ]- \$ V6 @* B* Z) f3 a9 f
( i3 B6 O" y5 W
# Y, s! `0 y: iIndividual Data (Maximum 10 marks available) ) l) t8 J$ [! @
! F; H1 i& N; N" I; X
5. You will be given two Megalodon staff member user names and passwords, plus a set
% p& n. ^+ j: Y: r7 }! R" M of data for each staff member to use to calculate repayment details. You will need to
; N/ m/ q3 E- b/ m) x: R; U3 r log onto the BSA104 Assignment 2 page on Vista to generate your individual data
% r, Y) T0 Y0 U1 {' k3 ^ and instructions for this requirement. You will need to use your University of
+ h+ Z7 ~) l& p9 a, w8 m+ S5 z7 ^' G% f Tasmania (UTas) student number.
: ~5 a( j7 r+ ]0 c; h0 j* W+ ~
% ~6 d* o i0 |. N; G5 s$ G; }+ X, V1 \( B" |9 z4 X
Page 2 of 5 9 ^* N5 y! q# S/ F/ w7 T8 E
, c# `7 E# Y0 |8 q0 \* U9 o
For requirement 5 use the following data:
# L7 w0 z" _' {7 d: s4 i0 k$ n
- v+ f# f) [9 |' Y. O \# Data Set 1:$ J: T% U2 [5 U# s7 k+ a( \
; G7 D8 j3 u" \$ \& u. ]+ @User name: JordanM
8 R4 n C6 N# T; d% a+ wPassword: Ferrari
# N4 y+ j! [; LBorrowed: $ 749.950 S) Y" Q" F' `- H; d+ p3 e2 t/ x! Q7 w
Interest: 15.0 %
! X* t4 I6 j* R6 i7 b6 n' H9 @Years: 4) L2 K; l. \4 Z+ M3 U% i1 U
]6 q1 e: e5 n; x% l
# Data Set 2:! L# W3 q% k' f7 C1 T; I2 G% R
6 h+ K$ d8 x9 b. q7 a3 cUser name: KimZ
3 l( G& Z% Z/ U+ q2 @4 c. T% V8 aPassword: DimSim
% F; \4 G0 W. u% i8 |. J! H$ y" cBorrowed: $ 150500.25
8 |& _' v4 w/ @Interest: 5.5 %- }+ I: Y! [7 c8 k: L( O9 t l
Years: 7/ O" F% v, U, t9 q, c- B+ n
* X4 R/ {8 ]: ^
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|