|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊
) C7 h4 r3 f$ S! }: c3 Z* e9 C有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
, o- e: @& _- r" H; cRequirements: * [; k: E" L5 f# S6 ~9 k9 c- f
Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the , W7 D( z9 }4 |- C& t) l% ?
Assignment 2 page on Vista.
: J$ ?7 n7 L7 [& v; ?! S 4 j# q, U$ N8 R" ]: e! b
You are required to perform the following tasks:
+ g! F6 \- p3 W% ^1 n8 c
; T3 ^4 b% N; @! ^" ~$ QThe RepayCalcMenu class: (Total maximum 20 marks available)
G4 v4 _6 \" `* v. D
5 {# c! c- o* ?& D& [; X9 C 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
% k1 R8 ]% U1 }0 G: o$ E* c Finance Company so that it can be used by the Megalodon staff members to
/ G5 @' [& ?) b" `7 O determine repayment options for their clients. % R% @; o$ B1 g; Q2 y
& G9 O* D% {* C6 A5 A: c
The staff must be able to:
; m0 b) T4 _% J) t! x9 j r2 U6 ~( j. i9 [" L3 z
* Log on to the ‘system’ using their user name and a Personal Identification 1 E9 ?/ A, z( J
Number (PIN), which a four digit number **.
4 V. Q z5 z' X7 f+ q$ _# f
3 P% p2 E( v/ ~% M& D( { * The user should not be able to use the ‘system’ until they have provided the 6 |5 p$ [' E5 F3 Q" p; h4 M
correct user name and PIN combination. You should give them a second or ( P" c# I2 d3 [$ H% i1 G( r- ?( E
third chance to get it right before shutting the ‘system’ down.
: m* J0 j3 j2 |# N* v
& Y5 H) E* m# X6 t5 G7 I3 ~% t# X 0 ?) g. k) O, Q9 ]: q+ i) l
0 z% s9 W! x& c& H( h ** You must use the user names and passwords provided in your individual + @# U& G( r0 ~) {: V, t2 F0 f$ P
( M1 j6 \/ J4 k4 }7 C7 d data available from the Assignment 2 page on Vista (see requirement 5 below).
R4 {5 H P$ [( }* s' l+ M0 u The user names and passwords should be included in your code, and the output
% l2 A" r6 Q5 w& R( z1 ~0 i" N to the screen should prompt the user with the user names and passwords (for
+ a, v+ w; f; C( z8 S
( Q- v4 q% F% w2 K6 E: _0 f marking purposes).
' p' I* }* s; B O7 X1 q2 z/ Q! F9 ]$ m1 r9 ]! U2 ]$ a! a0 I
- R/ E3 N# j8 X
A4 a8 b, i x7 Z* The interface should provide a menu so that the staff can:
" F1 F( H0 V3 a" z& b* g3 \. ]% t
+ ~5 o# L3 @# K9 q9 ^) m, D( o - Perform a Repayment calculation * Y( L- }) K" a6 }2 l
, G7 K5 L( U; m& j
- Print out to the screen the Repayment details : m H8 ~1 K3 F/ _
: P! s- Q! h" Y+ B, B# w - Change one, two, or all of the values for the current calculation - B0 V( k m" C5 H* L- o$ A0 o& |
# X6 a" Q, n7 d1 t - Start a new calculation
5 A; I/ R( x) V+ b% H
% _6 f- t+ d0 |% O3 q - Leave the program.
& g+ q, \. j- `2 W& b5 VThe RepayCalc class: (Total maximum 10 marks available) 5 j5 m8 h" b- N1 B$ |
$ Q8 s4 Z% G7 L. E" J# e 2. Provide a method to accept three input values from the user: 2 d4 M, B/ o% d/ _5 W4 q
+ m( q' f. d* `; v1 a D |; X
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) 4 A4 Y) h0 B* Z& _7 u, \
( F' r2 m ?" Y. v - the Annual Interest Rate (to 2 decimal places, for example, 9.75) ' t$ E) k( S' O
6 Y' _. h( {% Z; m# @/ e - the Period of Repayment (in whole Years, that is, no fractions of a year)
7 s& D3 j$ K! J% e9 ]2 x: ^1 p8 r+ A8 }0 H$ N
3. Provide a method to print out to the screen the three input values (accepted in + r5 O( d* b3 f8 _
requirement 2), plus the repayment calculations:
2 b/ T' b9 ]& f* D, T) D( q/ k e4 f% E' J* n
- the Weekly repayments
* v3 ?0 M, ]$ l) _; G% U
3 t6 J9 t: {5 `) ~) D: j - the Total repayment amount (Amount borrowed + Interest)
% T3 ~% E! s9 Z. i( i
6 S/ n s. S/ y c; u ) H( [3 |. L" ~1 R
; j% d5 D: b9 L1 B, N( P2 p; sThe Borrow class: (Total maximum 40 marks available)
6 [& ]; E$ {- [" c8 T+ U( U! F: G" r; r3 s4 P# |0 J5 ]
4. Provide methods to perform the following tasks: + R5 V2 H! S! U! i' @! I1 [/ j
1 W' f) x0 q" U+ Z# @- }7 ~- [
- to calculate the weekly repayments *** L5 A F4 S5 r$ a! F+ H% I
0 R4 `: a/ C$ U& i - to calculate the total repayment amount
0 s1 c5 O' v" d. B( ]; I5 P# z2 W% i" A7 O( ^" ^* v2 T
- to return the amount borrowed
( t5 y$ ~3 J5 O8 x* v9 A0 f' P" K1 K
- to return the borrowing period in years + X7 L7 z3 y! X
! M" _; O- y4 `: B0 i, `
- to return the borrowing period in weeks ' H2 k' T" y5 p) y
$ X9 Q9 k3 g/ q: ? - to return the annual interest rate
/ A; }/ v3 X) M4 e3 `* Z
4 C" G) w% Z2 _4 ~. z! S [ - to return the weekly repayments $ h$ V) W+ \1 _9 x
( v, ?0 `4 o& I5 a3 p0 S7 x7 ?6 D: V - to return the total repayment amount
, H0 d) N- C" g, h. |4 V q& h% ?
& Q# H7 F$ C- X' l7 B' g - to reset the loan amount & e6 Y5 m) h, d/ d& L: i' Q
! n4 ^+ j' p6 ?9 U# a, h - to reset the annual interest rate
( v+ Y/ }/ j3 B1 N
& N3 r; `+ T9 m ^, L - to reset the loan period (in years)
4 g/ x6 b5 w9 Q4 d) y- I/ b$ x- Z( z1 [9 N' r
' y) H G' P5 U; U( l
" x7 u, F. e" k4 N / j) [" a/ h: b L
* R, v8 i. M0 {& E3 s *** Use a simple interest calculation (not compound) formula, for example: ' g5 ]3 Y% X1 G& M
1 `8 f/ f( D7 Y( |" @ weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * 2 I' `( L9 n7 o& s5 B
numberOfYears )) / numberOfPayments; " {# X% A: l6 o# f* e# w7 V: n1 P& G& l
" g* y6 j* B0 n: L+ [; w# e( @ 0 ~% h* C- J8 u9 I: w3 z% q! Z
, [) e6 |: \1 x' z b# I 1 D0 V9 k5 @6 h+ H7 \- h; Y
. q9 e9 L) u9 C( I, M8 B& i* R$ R4 _
Individual Data (Maximum 10 marks available) ( l% A$ X. ^8 u; X h% R' n% M* i
- R* B! f9 i3 L6 P
5. You will be given two Megalodon staff member user names and passwords, plus a set
: f1 r. |9 |5 ^; [/ E' i% ]' a" r of data for each staff member to use to calculate repayment details. You will need to $ J! V( B9 I6 O& ]4 k7 g
log onto the BSA104 Assignment 2 page on Vista to generate your individual data
: i8 D. ^; o3 l" h6 X" ]! g* L and instructions for this requirement. You will need to use your University of # i7 Y( j1 p0 ?. T! x* j$ l
Tasmania (UTas) student number.
# `& F* k k! S2 I, N4 G : n! ~; B: \6 L; D2 R$ ^& t% T/ d2 e
5 e! V0 {) C$ t! `3 l Page 2 of 5 . v# Q3 T: R- S9 o8 W
* k: Q( q r$ u; ?
For requirement 5 use the following data:5 f0 l9 b+ W3 [1 @
- S9 o6 d- o, e5 j1 o
# Data Set 1:9 ^/ _- E2 X5 y. M; p2 c' V/ ?
) k' @- @5 a- Z; H0 B4 Q H5 K( wUser name: JordanM9 T0 e! J- e. K7 F
Password: Ferrari
" p' _( V( D7 I; S T+ \( y" n, G3 qBorrowed: $ 749.952 k1 s7 W8 g+ T, \9 w' e
Interest: 15.0 %* p5 e w6 ^" e* i. a, A+ C
Years: 4
+ Y- _* Q! Y' o
% V# u Z4 u/ I. }5 [+ x# Data Set 2:' B# v' [4 ]) G- |5 u& T
: x) k+ A% c. q, L
User name: KimZ
5 ~4 ^/ `; M& ~9 sPassword: DimSim+ Y" Y+ m9 R7 H& W) R. t8 V2 X% H
Borrowed: $ 150500.25
. k. O: ^% w5 d* ]Interest: 5.5 %
C5 S- P; d# w Y/ M" W- p6 @& WYears: 7
9 W) h; n' F; g
$ i" g" E) I, z( K[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|