|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊" [( a/ i6 T, I, k
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
7 c5 {5 r* a/ _) Q6 G: yRequirements:
# M% J9 o$ _0 W1 `& V! L* c/ @Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the ( X' t3 k8 e4 J
Assignment 2 page on Vista. , J3 P" J; v! ~; I& ~
" }: n1 Z8 K5 m8 vYou are required to perform the following tasks:
; d0 Z; r, u$ M' J! l5 N" j 4 q7 B& v8 W5 x( f6 L2 T8 Q, ?1 M
The RepayCalcMenu class: (Total maximum 20 marks available) 4 x$ ?# V- w2 x% `
" H' h# \2 W: W 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
& F7 ?+ J, q% W! U+ n& P3 e. L' N Finance Company so that it can be used by the Megalodon staff members to
# @4 j' g0 ~9 |, k* r determine repayment options for their clients.
$ e, x$ I5 n5 h7 z! i/ n- z/ d6 O
The staff must be able to:
# E0 p @& |: f; v" f* }- |' W" m6 E6 s [: A- m c; @
* Log on to the ‘system’ using their user name and a Personal Identification
* R7 Z7 |, ~5 Z5 q Number (PIN), which a four digit number **.
/ X/ n# G g' c" ^
' D$ t% t' w7 S! ^* y5 t; x * The user should not be able to use the ‘system’ until they have provided the 5 I" x& J. F; a$ A! {
correct user name and PIN combination. You should give them a second or
/ w/ o/ l' f/ G' a third chance to get it right before shutting the ‘system’ down. 2 _# n& r# N% l" Q K1 P" h
. _; a3 p% E. Q$ q* Y. w
- Z5 A$ H8 l# l! k4 E ^! d- V
% z$ L; j- x+ p' L6 Z" i; s# ^ ** You must use the user names and passwords provided in your individual / W$ ~ n5 O4 J: o. _) C
$ m: ^, K2 \# x% A4 S; D- R data available from the Assignment 2 page on Vista (see requirement 5 below). / y# m/ F* h4 u" ]8 d
The user names and passwords should be included in your code, and the output
* v6 S3 G0 E3 ^3 [8 r4 ] to the screen should prompt the user with the user names and passwords (for
# {$ ~. d7 H6 N5 Q; f$ e( o& Q, K$ ]6 U. F1 k1 ~
marking purposes).
* y9 c" z& {. B. N$ A( o8 y4 k7 }2 e( d m7 r2 m& ~# g( i$ [6 }9 k
, f/ x9 f3 t8 R( a+ r
/ ^4 i S+ T5 }- N0 B) o+ R* ^5 \* The interface should provide a menu so that the staff can:
2 E# q# ]2 o6 x, G) x
: P1 d4 O8 _7 g - Perform a Repayment calculation * R) x+ V5 n. ^7 t2 l
: P1 E7 {# z. ^* E! H - Print out to the screen the Repayment details
: [" m& g* w2 h: v2 w$ e+ Q: I9 f8 {/ q ]: A% Z
- Change one, two, or all of the values for the current calculation
0 Z0 Y. g3 }0 S$ A5 a1 h- q5 F0 ^0 I0 c5 k* H) g# T9 C- L: f
- Start a new calculation % C8 E& N# i& W2 t& r' ^, b
9 r$ N5 M$ |3 q N
- Leave the program.
+ ^6 O* Y& X( ^" gThe RepayCalc class: (Total maximum 10 marks available)
" ^4 k. S$ b6 P# P, S8 `% o2 ~( W4 |" w+ Z+ K$ f) a6 ^9 ]- F& i
2. Provide a method to accept three input values from the user:
" `/ \* o, ~* P; s; x/ m) I
# |( V' @ b% |7 [: d0 ?% ] - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
$ o6 Q9 {% ~) Q* h4 S6 | E. e8 m* f1 Y
- the Annual Interest Rate (to 2 decimal places, for example, 9.75)
4 J# ?7 }* v8 n4 G3 d- D3 k
5 e( R" V' ^" h5 x3 i* G - the Period of Repayment (in whole Years, that is, no fractions of a year)
2 l! q' _, z* r
; Q4 _9 R1 Q w) M; v2 F. l 3. Provide a method to print out to the screen the three input values (accepted in
7 S6 o. D8 z; |. q( K requirement 2), plus the repayment calculations: . \( p0 J) i4 ]" k) a
o( b9 p+ H1 v9 q) E; T; V' t# H' r
- the Weekly repayments . T: B/ e: ^" z6 T/ m
S3 v5 D6 |6 x5 T3 l, E2 c - the Total repayment amount (Amount borrowed + Interest) 8 d6 ^1 m4 J+ C
2 Y+ C/ U$ @* B- L! C2 A ! E: x. p/ G6 ?
r9 ]4 o* x3 f h7 KThe Borrow class: (Total maximum 40 marks available) 6 T8 u+ Z! o+ r; z7 b! V
5 F+ I1 {4 e. C. b& G! G
4. Provide methods to perform the following tasks: 5 X G# A' B+ [- i- S- ^
8 F" B/ N# W* d+ @
- to calculate the weekly repayments *** + d$ Q U8 c, m, x; ~) {! Y
5 A8 `$ |9 m0 s+ I& R R - to calculate the total repayment amount 3 s0 c! J: B) `4 T0 @! @
3 G$ i `* x' i+ g! q+ [/ k4 z
- to return the amount borrowed
& \# ^! |& d) G/ S3 p9 R
( r2 [/ n: m7 s: x! `5 G; [- ` - to return the borrowing period in years
5 R ~5 F; D, b1 P+ R4 Q( [ z5 w( ^- C3 p: o# M0 \: Q
- to return the borrowing period in weeks
8 z! Y, I0 X) I3 H% y" Y: o. D1 Z+ c& p3 a( [/ l
- to return the annual interest rate
" F7 y* `3 ]# h, B" a7 m" Q% t9 _% F, x7 ~9 r( H8 h
- to return the weekly repayments z0 a' q- j' Q! c% x* n9 ]
: ]8 [3 E2 f: a! K' Z - to return the total repayment amount
3 g# E& \* ]4 E& }' y7 Z
6 W: z2 o2 b& |6 a - to reset the loan amount / H! Z5 U% v( }! X! ~1 o
) ]& v) d! b9 `7 g! U( S9 p
- to reset the annual interest rate ' V4 x/ r7 N8 Y6 _7 k4 V
" K& R9 V( K( r, d3 K2 ?. q. y - to reset the loan period (in years) 3 A; X( w) }. S
! F2 Y) s: C* H3 _& u
* l, u# V" V; L' }
% e. g$ z2 T& y6 t" z( S5 Q
6 E. I; G: J) H, J+ d3 e
. ~8 H$ c+ X; E( t, S5 F
*** Use a simple interest calculation (not compound) formula, for example:
6 u0 P( E" u. a! D1 h! A. ~ ; l, f/ Q( \8 |& i
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
i) Z2 l/ Q6 D$ R: U numberOfYears )) / numberOfPayments; # d2 Q6 L% [5 r" ?
5 Q5 M' C% \% u+ d/ @ - k1 V' {3 ]5 J/ X x
& y* e- M( v9 Q* R+ g3 H2 r1 R- ~
6 w& r6 E% J: S4 G, r# t
! U0 l5 t2 m3 o) P- E3 EIndividual Data (Maximum 10 marks available)
& k: H( ?" ]9 ?& I
* W# p) k3 E. { 5. You will be given two Megalodon staff member user names and passwords, plus a set
2 u! {. h1 e o$ R" Y/ E" n0 f of data for each staff member to use to calculate repayment details. You will need to
7 Q$ n3 n; l0 C# ]: P) k log onto the BSA104 Assignment 2 page on Vista to generate your individual data 6 ]! i& E e+ ~: t7 y6 y
and instructions for this requirement. You will need to use your University of . t: P' j- n$ {; y! Q# c
Tasmania (UTas) student number.
5 \* L+ b t* H+ I8 h6 _
, v: ?! o* [, K4 p2 k: z- ]0 b; m
+ k6 Q7 W0 z/ U5 C9 `7 C/ H8 j9 I Page 2 of 5
# S. a/ P+ Y0 @( _, z& j! z2 c
" J7 M7 t/ @; |! LFor requirement 5 use the following data:
, [& T4 B, K- D' A# R2 y5 l, t. B) J3 x' ?1 M: o1 }
# Data Set 1:
0 f+ ~) R- @& h4 E3 S: J" i+ B, L7 L# N, E8 l& i f$ Q9 A1 d
User name: JordanM
8 d) B. p/ B1 R* d# k( t, EPassword: Ferrari* m- H) z- X1 |9 C/ I
Borrowed: $ 749.95
, O% G% y: A% j) IInterest: 15.0 %
6 D$ |! m. \+ S& o3 m$ h. | ?Years: 4. W' Z0 k& T1 o# Z4 v
7 v1 R, K3 v& _( M# Data Set 2:
) x$ B. _. g- ~) ]
: w) `2 R' i! gUser name: KimZ
5 @' L2 r) r" o# Q4 d( n! BPassword: DimSim+ z4 A+ @4 y. T1 d2 N* J
Borrowed: $ 150500.25
9 V ]$ D! }; S( e- q% g2 ~/ fInterest: 5.5 %& g8 t4 A7 k1 x" d
Years: 7
7 k% M9 \( J' s
5 t6 z- i# }9 r7 u1 Q[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|