|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊* g5 a* ]- t: z5 p
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦3 J1 b/ i: a( @& d3 ]. M% u
Requirements:
p! h- |6 C1 O: S) b6 l; LConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the 8 K" p7 r0 w: p) A6 r
Assignment 2 page on Vista.
+ l3 l' M+ [, x& F 9 f+ G3 r0 r" Y6 k @
You are required to perform the following tasks:
2 Q) K2 p4 V0 m5 L* Z# ]
; Z9 t7 \9 D$ K- U2 G7 i+ eThe RepayCalcMenu class: (Total maximum 20 marks available) / W) t( _. m! `7 t+ ?" u" S( E: `
! l. o' b+ ? d: Q( W9 J. ^ 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon 1 U5 u) h7 q& e- r, y, L
Finance Company so that it can be used by the Megalodon staff members to
; ~! n8 [, d8 ?/ N9 y3 N& C determine repayment options for their clients. 5 X- Z9 L6 d- _! G8 X8 W v" B
* F7 f' O6 S! p) V" U4 k
The staff must be able to:
% F- }8 T7 D. d/ N& `4 X! X8 O
* k0 T+ ?. l q4 H3 x8 L * Log on to the ‘system’ using their user name and a Personal Identification 9 `- M7 Z) P6 |" p/ x, L
Number (PIN), which a four digit number **. 2 j6 z0 g" U' s6 H I+ M; Q, n/ I
% |" _/ D( w- B' B* K * The user should not be able to use the ‘system’ until they have provided the
) g1 @8 |# u1 E5 Q correct user name and PIN combination. You should give them a second or
- w/ M2 T4 J. [4 R* t+ ~ third chance to get it right before shutting the ‘system’ down.
1 j7 G! B4 K. m1 o+ _; {) c4 o6 _" _8 d7 J! Q4 G2 s1 u7 ^% i( w9 S3 u
6 N1 ^, E4 m# @9 l . O I- q1 i( M/ u! K" P
** You must use the user names and passwords provided in your individual
& z' a$ C5 h: t4 u% n t/ q+ k& k0 B4 v9 H t
data available from the Assignment 2 page on Vista (see requirement 5 below). 5 Q' M$ p/ m) j2 x& F/ @7 Q) u
The user names and passwords should be included in your code, and the output 4 R/ [& W1 @) G* P
to the screen should prompt the user with the user names and passwords (for 4 o; g) M+ Q7 N7 q8 ~
1 F p- p6 |* W( f; { marking purposes). 1 V# S2 f2 g; s" g V8 T% o8 |
" _2 _) j9 j- D! K# r6 {+ r
& u6 s0 ^1 X0 A: q7 f" B) |
5 J, r y4 I1 Y" t1 ^) S% f* The interface should provide a menu so that the staff can: & Q2 W2 U0 W! c8 G; h
; \1 e8 d9 N1 f
- Perform a Repayment calculation
( L; H& E- X& w/ X$ z* P# z/ p# x2 v( B
- Print out to the screen the Repayment details
" a: U9 ^6 Z8 c8 e0 P/ C
, \& ^" ?+ g: p. N( T - Change one, two, or all of the values for the current calculation " @3 l( p/ f0 Z# n$ b
/ |* y+ m; r: P# G! `5 F
- Start a new calculation % u& _! n2 d& x& }! Z4 C* p# }
& C! g" M: Z1 E9 [" A
- Leave the program. G3 ~# N# ^' I4 K; Y( `
The RepayCalc class: (Total maximum 10 marks available) 2 P$ f0 k0 ]- O: d# O
4 @' h2 @$ ~ I! N
2. Provide a method to accept three input values from the user:
' b/ W# P( z" S3 \0 z+ P
; S) Y& {1 [% l- ] - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
& D6 s, `* l& _6 Q, g6 R. `
* s; O" h' U8 l+ D S: v" _2 R3 Q1 D/ J - the Annual Interest Rate (to 2 decimal places, for example, 9.75) 4 y# ^* M8 n' }8 \- y! ?! g
0 |$ y1 V& A P
- the Period of Repayment (in whole Years, that is, no fractions of a year)
y, j }5 {/ a
) ~* f9 m; ~* k9 {# } 3. Provide a method to print out to the screen the three input values (accepted in
6 C: y3 U j9 c2 ?; N requirement 2), plus the repayment calculations:
4 {" z0 X, Y; t {$ V) L: x" i4 ?% S, N, W5 n3 ?; r
- the Weekly repayments : e5 d9 s0 T5 M& H7 h
- i P4 g* B: X8 T+ V
- the Total repayment amount (Amount borrowed + Interest)
i, M6 {+ D4 w2 @9 F k, s$ C. z/ [1 C* H9 H d
3 ~ F+ U! R( W
: B- X/ c: `& x
The Borrow class: (Total maximum 40 marks available) ; U! t' _* p0 A, L- M/ {
6 B6 b; [! k; |1 l c 4. Provide methods to perform the following tasks: , h- Z6 g9 B6 _2 {+ f* E$ c
* ]- R% g* D ?
- to calculate the weekly repayments *** 0 d9 J& y' [$ T
- l& D. @. K8 h- G9 `( }6 ]6 A
- to calculate the total repayment amount 2 J. m9 ~3 M' {) o
& ?6 B, N. H. e2 Y - to return the amount borrowed
3 u! {$ p8 X! N8 H
' g7 k0 O4 `/ @8 r, H+ l# D/ D - to return the borrowing period in years : p g9 b) m+ c; [' J5 S
3 C8 r/ F& \8 {* o/ o! H% y - to return the borrowing period in weeks & d" X6 [! v0 e. f
/ e" H$ ?; A( B9 e* I8 C - to return the annual interest rate
+ p4 M% ^$ G! R+ S
9 y7 W0 L8 }7 X3 W) B - to return the weekly repayments 3 c" g( R% \2 U8 u* r) @
+ c0 ?- \8 a7 h$ @6 n
- to return the total repayment amount
2 p3 [8 Y9 Z3 K+ h5 P
+ }" U1 d1 _- m0 R" [+ D/ ? - to reset the loan amount
5 v X4 J$ X( }5 x0 F4 w
, G* T) R5 T% R8 f% }$ m9 x8 ~ - to reset the annual interest rate
: ?6 k/ x9 c' G) C) E3 `
. `+ O# `1 t( ~* J! L - to reset the loan period (in years)
" B# Q D1 O, w4 U: [4 J) g& U! Z7 H6 K& V+ K% n
: f( s6 Q* H0 x( |/ C& J7 }( E
6 H) }: _$ M4 r9 k* C. o
( ?4 A; }' K& y % [5 w5 h% ~9 Z0 n+ _; v- q
*** Use a simple interest calculation (not compound) formula, for example:
7 n( E4 R; X9 }* r ) T- i$ u6 C6 ?* ~% P2 g( }
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * # {5 x9 [& F( X6 p* ?
numberOfYears )) / numberOfPayments; " h$ C! W4 l+ r1 z
0 d# H4 ]1 l. L/ }0 C) f2 k ; z2 k6 b( V8 l3 ^1 e c
! p" _ b* t# t% M ; a5 s1 o* X4 }2 ?
4 O+ Z7 c3 |+ \ FIndividual Data (Maximum 10 marks available) 2 f& ^, m7 N5 b9 s$ w \
& w3 ?3 D6 u+ X$ j' C4 j 5. You will be given two Megalodon staff member user names and passwords, plus a set
" O. Y+ g0 h) i# Q2 }5 c of data for each staff member to use to calculate repayment details. You will need to * [1 ?: x- F; K. L# R: p
log onto the BSA104 Assignment 2 page on Vista to generate your individual data 6 ]2 o2 l) U, k6 y8 ?
and instructions for this requirement. You will need to use your University of
& I5 A: ?4 f( K8 b4 W% m Tasmania (UTas) student number. : J8 I3 u2 }1 [! k1 c
7 n0 H; o3 K- @# R% p, a
/ x( I e2 t& C( @* }
Page 2 of 5 # r" K3 x+ }# a; @. W
& D) k& C* d( {( `9 R& O$ |- F
For requirement 5 use the following data:
# }0 P( e4 ^2 m
) W. j. `# _3 q- \# Data Set 1:9 B% X0 W# p* ^( s. I Q
" q7 Z+ A3 M9 r" d7 g
User name: JordanM8 o( C/ H- a1 e4 L: x G
Password: Ferrari* n. j6 K& l! M
Borrowed: $ 749.95
! ]9 M& Y2 l4 v2 ^Interest: 15.0 %
7 {2 Q* t7 D& X' E* yYears: 4$ c& m/ `4 w4 O- f9 T. a; e3 F4 y
% H% q+ Z) r7 ?0 g# Data Set 2:. P! J1 L4 \% V6 ~' x& v( T3 S
) }! S. l# ]# H5 M: e
User name: KimZ
7 Q* y* f: `7 K' U# x# V8 R0 t' oPassword: DimSim! r. r* _! X7 a9 \* B
Borrowed: $ 150500.25
% R* [" I; \& T. ?2 X: W, {Interest: 5.5 %+ ~+ l* J. k) t1 [5 y" p
Years: 71 u+ C) r) c! J! v4 J; }
/ c) V+ U8 k* n' L8 W. ]
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|