|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊
) y- g8 V2 }) p# a' d0 j- U. A有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
2 y7 |9 _9 X! e: F5 ^Requirements:
. f' H- ~3 s1 O$ T' K: _# e# xConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the 9 t4 G0 k- J' z7 i2 v* j, _, ~
Assignment 2 page on Vista. * k& i9 E$ E- o
6 T+ h! I+ V5 I2 v
You are required to perform the following tasks:
# C6 t; a A. i- S0 @" i 7 c7 }" h, f7 g; D+ Z; V
The RepayCalcMenu class: (Total maximum 20 marks available) , {4 D. O! a" i2 o3 d+ E
' n i2 {' C3 Q- [, F0 K1 m: r! r2 i
1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
- B4 b" W5 {2 A- E# b Finance Company so that it can be used by the Megalodon staff members to
4 _* J4 J& g# Y% f+ j/ b9 u determine repayment options for their clients.
' Q2 {7 K+ t: ?& p6 w( v/ p7 U/ d0 {+ H' w! u) s& u/ v4 c; |! q
The staff must be able to:
& X; A X6 k% Q% v7 D6 @% A" H& C2 P; l# d7 g6 O+ `! `! x
* Log on to the ‘system’ using their user name and a Personal Identification
2 ]* E+ M6 P' k# O Number (PIN), which a four digit number **. ! ]( o k9 ~/ `, [% F
6 q+ E4 V+ p- p7 c& v * The user should not be able to use the ‘system’ until they have provided the
+ p6 U) c5 x+ L7 R8 V8 r$ E correct user name and PIN combination. You should give them a second or $ J& X0 _, N! t# m% r9 l# u
third chance to get it right before shutting the ‘system’ down. / h1 B- ^' V( n5 f+ w3 }
- l* }" C( n/ L7 U. q& N
1 C+ ]3 k) [3 @* \. r 8 Y- k: S" R3 v* b% Q1 W
** You must use the user names and passwords provided in your individual
. E3 ^8 D1 f7 N" i
' v* W& C* h( N! S* j5 z data available from the Assignment 2 page on Vista (see requirement 5 below). 1 r! c4 v) x. |6 b1 D3 R- L; e
The user names and passwords should be included in your code, and the output 9 D! V! g- z. a1 ~
to the screen should prompt the user with the user names and passwords (for 4 y% P1 N% d. R9 A2 o7 @8 b
& Q" _" ?: J( R! P" y
marking purposes). & M5 L- w! [/ t ?9 m0 B6 o
+ R; X3 G' k# g$ a
2 @2 l8 f" A' e& j9 B( k0 e
' y9 v) u" ^( {8 X* The interface should provide a menu so that the staff can: / c4 I4 s8 i% j& b
; h7 @+ {! y) ]2 m
- Perform a Repayment calculation 4 _' G4 X) n9 ?9 E% j3 ? X3 T
& Z( m7 L" k- {9 _4 `
- Print out to the screen the Repayment details 6 T. |& t" }6 h- c: w; f( S
' Y9 N8 a, L1 S! p& z - Change one, two, or all of the values for the current calculation ' c1 f$ [ \* o `! o4 Y' V5 q
! F, _) C i" m5 [5 F1 W; V9 {8 v - Start a new calculation
& {. r2 j2 @7 X7 v" z, p
: S: ~: h" ^4 r) V5 Y3 a% m5 v1 [ - Leave the program. 1 t3 Z6 G' _. @$ t0 y1 P
The RepayCalc class: (Total maximum 10 marks available) ' \! `5 X* R4 H
6 }; Y/ C' l! r/ s
2. Provide a method to accept three input values from the user:
( N$ k) v0 j! s, ~2 k W) y! p! A( y U {
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
+ G( R: w( t% T/ r; V
* l- m) a2 _3 l1 R - the Annual Interest Rate (to 2 decimal places, for example, 9.75) 0 h. v, m$ Z* ~: ]4 g
9 N$ k9 @4 N7 m: j& l6 B# i* p
- the Period of Repayment (in whole Years, that is, no fractions of a year) 0 I0 s& r5 H' K/ I( w6 a
_* y' f5 a) R2 @2 f9 z+ ]
3. Provide a method to print out to the screen the three input values (accepted in
, f$ ~* j4 i8 n* R* ^3 d. s6 R" x( s. t requirement 2), plus the repayment calculations:
1 u7 E& L' q4 O3 q( L1 a# d1 a6 g' v: ?. `) P
- the Weekly repayments 2 k: j' ]4 x0 L1 F( p) u
& V" J0 c0 z. ~0 y& D, \
- the Total repayment amount (Amount borrowed + Interest)
) |3 J4 D& G) K( Q6 f5 G. ]
; p0 X0 X& {; }0 j' a
4 ~, d+ O- M( \. l6 F% O5 ~
, p/ S0 W% y& y k n3 y/ N: q, kThe Borrow class: (Total maximum 40 marks available)
) V7 L% y6 O, n9 y. M$ E4 u- {* t/ W0 w5 k+ k9 ~ E$ ^; S
4. Provide methods to perform the following tasks: ) D& g# n4 `+ I, M s. ~& x, w5 R
* {& Q5 ?+ p' K& M1 h - to calculate the weekly repayments *** : D5 D: U# r, J2 W- ~
J2 F4 o( c- n2 ~ - to calculate the total repayment amount + `, z% a3 D) c) s) v
$ \- [+ N4 V7 W: K5 t - to return the amount borrowed
6 _6 i8 M" B k$ @
* B4 d- R. c# S2 p - to return the borrowing period in years 4 |$ I# }" ~, y
' {) K" p7 w: Y4 i, G+ N+ q - to return the borrowing period in weeks
# f2 Q2 {3 E, e! Q- E8 N& U: h( E7 @$ z4 I* k# w! E
- to return the annual interest rate ! S; R" d8 b, k% _2 d) H
1 n7 e# Y' K; L0 J) U
- to return the weekly repayments ; y, u/ j& f$ S3 ?: @
2 l7 i+ Q5 _/ I: G, e0 L( z a - to return the total repayment amount
3 \! A3 R: n J
4 K# O& B. ~) h6 B6 s9 g2 c/ p/ g! y - to reset the loan amount
, u3 e" a# h. B8 h# V( G7 \7 {/ J3 s& t! q! r( C7 ]
- to reset the annual interest rate
5 b( o9 V* v$ }& m+ W( Y. _, M6 W3 {: E# f0 T/ T
- to reset the loan period (in years) * g* b, g$ ?+ ~8 F1 \) l/ V
! `8 y3 r& ~ A& U0 j6 g4 c4 P- \+ i
0 I: a- D' J: ^6 n! q5 K! f3 ~7 w' L A; p$ t4 W
0 A9 d" K5 S# Y7 Z* x. C
. e% v$ V4 G5 I. ~" u
*** Use a simple interest calculation (not compound) formula, for example:
4 R) ^/ T5 S% o- U$ m8 r
1 u, A& F# M2 B+ a) I( Z3 C weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
f( I( o! v% n numberOfYears )) / numberOfPayments; # F) P: O: b0 g) P$ I9 ?
& a! \# a. T! ~! U2 O# [. ^ / {1 X6 I# \* X/ r: P# e
& Q4 ?; U4 ?- W$ _: S e 7 a% ?4 S! t/ W
- P0 Y. {0 g% d: q% h# g4 b2 @Individual Data (Maximum 10 marks available)
& V* O4 Y7 S- s! m. {
( B$ z1 m) o( R/ B% ]" o1 J1 Y 5. You will be given two Megalodon staff member user names and passwords, plus a set
: m. ^8 A. [0 k; g4 o, e of data for each staff member to use to calculate repayment details. You will need to
, I" A* N; P% v: B4 U; A log onto the BSA104 Assignment 2 page on Vista to generate your individual data
0 y# k2 ~1 V/ M5 j0 Y6 Q6 K and instructions for this requirement. You will need to use your University of
, `. g3 Z# R# Y' a Tasmania (UTas) student number.
2 c- ]( d- o3 B' a
3 q2 T9 Q, E4 y/ o! p& [% O5 g% A' l6 Z, X* H* _
Page 2 of 5
8 p+ o. e0 a, v R `! w6 T, _' |8 h+ G1 N: B7 q
For requirement 5 use the following data:
6 E7 v% u6 d# o
1 p; y9 a/ X0 K2 a, H% Q" k4 h& H# Data Set 1:! U' U0 ?; C: O( |9 B6 @
6 q, S- f7 `1 ~3 N/ H
User name: JordanM
9 z, F' O, V0 ]9 q* o J. aPassword: Ferrari
( n |( B6 a* RBorrowed: $ 749.957 j! h8 [7 M, }3 s; B
Interest: 15.0 %
1 r8 ^+ P& A; r" I8 ]/ h) w& A9 iYears: 4
G2 |8 Q: ]" z/ s* o7 Q1 s% E2 E
# Data Set 2:" p; V n2 ^' w. u+ i
& B F/ B) A1 K2 Q
User name: KimZ
9 V& y0 `; B4 bPassword: DimSim0 K8 I8 r9 e. m/ [/ p
Borrowed: $ 150500.25
: ^8 W* e% O/ ]3 {Interest: 5.5 %
$ w1 Q! O, [ p% y1 |Years: 75 J: e; L% d R1 ?7 S
2 o3 ]( p/ I- w# a {
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|