|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊
/ e. Y1 d7 z6 u/ Z# A S有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦" c6 U- K- I, w6 C
Requirements:
! A7 A# _, `/ [+ U3 pConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the . i/ j( t+ w+ ]! |( H, R
Assignment 2 page on Vista. / u4 Z! }) B- f b( ^. q ~ D+ d
/ D* d1 d6 ]. ?+ ?$ NYou are required to perform the following tasks: 5 n: {4 C2 G! \7 T; {7 w
# Q" @9 u6 Y: D% `
The RepayCalcMenu class: (Total maximum 20 marks available)
+ N5 h+ u: k4 g& }' `' P$ R. e# z. k6 p# y8 l) s, E" n
1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon " Q' m. e; M1 S- G$ ?: }
Finance Company so that it can be used by the Megalodon staff members to
/ ^) e I7 b# v( w7 ]- y# J( c' l' V- W8 G determine repayment options for their clients. ) Z x G# x! U
1 ]9 F5 A: k1 L& O' E+ v7 Q5 M
The staff must be able to:
# Q. E* X+ K: K, r7 }: {) H6 C; j- m1 t: h" G' N2 R
* Log on to the ‘system’ using their user name and a Personal Identification
. e5 d4 O* `9 L( Q Number (PIN), which a four digit number **. s2 R7 \1 v( d, z. e3 I. o) Y+ C
: C+ u% d9 V* D' H1 x! h * The user should not be able to use the ‘system’ until they have provided the 8 r: k" ?$ g$ F: @& N# A! S
correct user name and PIN combination. You should give them a second or
+ N4 e+ c% U$ i" D third chance to get it right before shutting the ‘system’ down. 2 O+ R7 d/ Y( b* O0 e
) F! O' D t6 K* O
( x- W5 T& U: I9 k# |
; w, ^! k7 K; Q6 V* P4 j& j ** You must use the user names and passwords provided in your individual
# G5 I; k- v! `% U: {2 Y' F8 }! j- g* Z& h! `) v
data available from the Assignment 2 page on Vista (see requirement 5 below).
, v) T) |/ m4 ^, L The user names and passwords should be included in your code, and the output
2 [8 Y+ \: y: {5 v& h' b to the screen should prompt the user with the user names and passwords (for
, @' o P6 {7 `. Q- \0 m
' L" k- M% u/ {+ I1 \3 m, W6 @ marking purposes). ( f8 X7 ?, ^& ]' A
- F! t) x$ ^5 T' f+ Q" U7 f / \$ q8 V' m8 z5 D
" v6 y, z+ Z2 F! ?- U9 }% K
* The interface should provide a menu so that the staff can: & F5 {2 \$ |' M) s1 b: k+ I
' v1 B; Z( u8 C7 @( q( o
- Perform a Repayment calculation
: {1 C, }% ~4 C' y$ k. d& X, n* c$ r. n: t1 Y D( @+ Q
- Print out to the screen the Repayment details
! h! y+ ~, m% i5 o1 [$ o% x' c) r- k1 ~+ Z' \$ c0 o& z
- Change one, two, or all of the values for the current calculation 9 A) L2 M0 ^2 S& [
3 J. U+ Y* C& T& R) b, S
- Start a new calculation 6 c: r6 ^0 V! w2 K1 N0 j
M" E: u& G* V6 U2 V$ S+ q - Leave the program.
- e; |4 P. F6 gThe RepayCalc class: (Total maximum 10 marks available)
7 l# s `$ [" Q
/ d( f+ w ?" `' q- ^& u 2. Provide a method to accept three input values from the user:
: K- j. f; P& w
9 e! j B4 D/ k P$ ]+ i9 z - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
6 `: C1 v3 |1 Y0 w4 z: ^
3 y: D+ z" J- x! O - the Annual Interest Rate (to 2 decimal places, for example, 9.75) / Z/ @$ N3 e- H0 l+ _
: p8 T1 y& D( v
- the Period of Repayment (in whole Years, that is, no fractions of a year)
' @" l/ b+ x8 X7 _( @0 v7 U% V. l5 V+ j6 O# T7 [
3. Provide a method to print out to the screen the three input values (accepted in 4 ~8 M1 r% @. c" e, m2 j, @
requirement 2), plus the repayment calculations:
/ X0 ?2 G* T: ~1 Q3 D6 l6 V3 M# s" X
- the Weekly repayments
' `& o/ z2 Y! z0 g- |& w
% w( o+ ~: }, s- Q0 U. { - the Total repayment amount (Amount borrowed + Interest) , `6 N, T" ~2 G' Z7 Y
+ a% _2 e, `5 I5 T * {& q* X) S% Q* d0 S3 ]% T$ ]
# F3 G. z4 v# [% O
The Borrow class: (Total maximum 40 marks available) 6 {/ h1 {: P2 o+ Y2 j
: ^) r. W& U' X/ O5 J0 H, r0 ` 4. Provide methods to perform the following tasks:
$ |7 ?5 r; F# E2 c' d. J+ i4 n$ e0 n
- to calculate the weekly repayments ***
" x) ?2 s2 h" o/ Y' r0 }' K2 i) d/ }! U( N
- to calculate the total repayment amount
- M! U, Y. J5 ?0 ]7 p
6 z0 q4 R$ B7 X" o, j% d8 T - to return the amount borrowed
' q* G3 o( C/ c; x& N! U
( Q% i# M. p. \4 q8 v - to return the borrowing period in years
4 [) e3 W/ n4 {! \" G' [8 F6 w
+ _% B7 d& _5 P, P5 V6 w: D5 Q5 J - to return the borrowing period in weeks
# X3 m, K+ L( ^& g% N, ?3 f: T6 o* u% f- K
- to return the annual interest rate - x/ w3 H5 o* R ] D& i/ a
6 f+ D2 t6 \# h* E: V
- to return the weekly repayments
' F) z' `8 H" T" v+ Y
. ~3 ]7 k3 p% T9 I. R( F" r - to return the total repayment amount / y1 e, [! e9 P, P# j
. D7 p+ F$ p% w3 J2 K - to reset the loan amount
4 c" _% t9 M. W; F; ^9 N m: f" z" f' b4 S& u4 M
- to reset the annual interest rate
7 X* z6 p- F7 J& _0 h R+ _# j$ \8 u, |7 J
- to reset the loan period (in years)
8 z7 Q2 [3 K2 e& z8 I( B, P+ e
+ P" @# w( z% r
7 [# q" ?* j1 }+ G" ^* z% [# ]& c. w$ N, X% e& Q `
. d% l$ I/ z( @& T' Z- |
, K( `- i7 _6 X *** Use a simple interest calculation (not compound) formula, for example:
. B( Q8 T. r4 X' f0 g7 f* ^ & d' n7 s8 x* ? M2 {) { R
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
! G- ~( j m3 y8 F% ]5 R0 d: |; y numberOfYears )) / numberOfPayments; y) Z7 O* r* x, [6 M6 C
# F; x7 C# u; u6 ~& E; d
% W9 C* ]& w6 I4 N% F5 U2 u! n- Y7 k' M
+ w( d; n, S: \1 z F% q8 j
, K( n0 `' N) v1 [0 ZIndividual Data (Maximum 10 marks available) 6 r! H( M+ ~' |
) Y4 t8 j3 C o
5. You will be given two Megalodon staff member user names and passwords, plus a set
; s' o7 J. n. i6 W of data for each staff member to use to calculate repayment details. You will need to # Y$ \! ?/ H3 Y; i$ s. e# i
log onto the BSA104 Assignment 2 page on Vista to generate your individual data
$ }0 O3 `- }) t0 N2 {- g and instructions for this requirement. You will need to use your University of % U6 U: r- S. J8 l, G
Tasmania (UTas) student number.
, d) O& ?% L( j+ F8 H6 {/ r
! U0 D8 h7 `7 }0 ]& ~# D7 m( y. i( C) J; Z& c
Page 2 of 5
; Z3 C( Z# u( T: g) B6 ]; Z( b. E! K8 @/ F; x' |
For requirement 5 use the following data:6 E/ Z5 e( ]1 r, _6 r) \2 u
0 p) q5 r6 q+ {: Z# Data Set 1:; M: p: A# H0 _& n4 ]
, \0 w# F$ R& u% f) e7 \User name: JordanM6 ]+ k" S6 b) W" S9 {
Password: Ferrari" q& d8 c& d) @
Borrowed: $ 749.95
# Y) O% X( Q/ d hInterest: 15.0 %
3 s$ s! r" W4 U% n k$ p" m1 QYears: 4
( c! U7 ~: X* q! o" ?6 o m6 c% j5 H5 o4 y
# Data Set 2:
0 U5 {& T3 k/ y, D5 K* m+ P
6 V z' k+ g! C: lUser name: KimZ
. K* N! I2 E! j! @. bPassword: DimSim' E0 v8 ]/ U' O( ^9 r0 E5 \* r3 U
Borrowed: $ 150500.254 K" q2 B5 I/ t P$ |4 N
Interest: 5.5 %7 N6 K, N) G5 L$ s0 i! w6 H8 W
Years: 7
. M. h( p. L; {, u* N5 Y& j$ c7 E9 T
8 d% D' [6 n6 C3 r, t$ C[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|