|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊, N Z8 p3 N3 L: B
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦) x, ^; g/ D) ~5 r# }4 u7 R* G
Requirements:
9 k. T( e, P* P0 A; u" wConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the " w w; E0 b' g6 z
Assignment 2 page on Vista. f J0 n7 X7 f( o
- S% E! z1 Y. x' kYou are required to perform the following tasks:
) k- M% Z, a$ F G
7 l7 s: w% M! j, B$ w. ZThe RepayCalcMenu class: (Total maximum 20 marks available)
* j; b1 M, n. f: ^
2 M I- _& t- c2 F$ Z# k# i5 U 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon - o) B4 H' i* i% Z# Q& R' b
Finance Company so that it can be used by the Megalodon staff members to
% i$ v$ a$ _- [+ S$ @+ o& |* J determine repayment options for their clients. ! K' C" o2 g8 ~1 A! x: _5 X: D$ H
" ]# } I! z0 l, y6 W# t The staff must be able to:
2 u2 I+ l" f6 ?8 @4 j5 E; g
! `' A9 O) E9 s1 m- j+ [8 _* | * Log on to the ‘system’ using their user name and a Personal Identification
' R/ w: n8 j- B$ F Number (PIN), which a four digit number **. ) s+ K* {8 P! }
l E9 C' A# H8 p! Q7 L$ ^ * The user should not be able to use the ‘system’ until they have provided the 0 u6 X `; ]2 l/ k5 D) e
correct user name and PIN combination. You should give them a second or
& x& x% m( C9 ^ third chance to get it right before shutting the ‘system’ down.
1 u) w9 T2 C6 }* b8 u
) Q5 F3 T; K8 N5 F/ }
6 @2 |% e7 F9 G, p1 l
" |4 _ e0 z2 U& A8 w( o ** You must use the user names and passwords provided in your individual
' V/ x( R& o, X# Q; X Z: D$ q
F3 t# y. |4 N1 c& K data available from the Assignment 2 page on Vista (see requirement 5 below). & P& f, n& N0 Z C" m7 N- p6 ]
The user names and passwords should be included in your code, and the output 9 V- ^, w( N4 e
to the screen should prompt the user with the user names and passwords (for
) I, J, ]6 ]" U# B/ Q! W- c
" s I1 |1 T1 |2 Q marking purposes).
9 X7 G; H' q" x) J+ T4 z
2 ^4 d6 i& Y" O" V 9 M2 t8 W- t9 x, y6 e
8 U" S4 ]; K# q' N, X% a* The interface should provide a menu so that the staff can:
/ I+ a' R: ]6 H( H# R
( I$ Z0 x2 B- ~8 D: F5 R - Perform a Repayment calculation ; I( j# e: q! V# s
. f3 M8 a# \0 ?- j
- Print out to the screen the Repayment details $ |& l( |8 w8 u; `
$ J, P4 l7 H5 M$ ] o$ o
- Change one, two, or all of the values for the current calculation
" y8 A. F+ e/ s! L
$ T/ c0 Q! F1 z* Y - Start a new calculation $ Z; w! O) t J/ e2 \
% b4 B- P6 T1 y; q - Leave the program.
8 m9 P+ h6 L7 ]The RepayCalc class: (Total maximum 10 marks available)
7 L/ Y2 p- g, s5 x9 q
* f0 @$ c n& u5 g 2. Provide a method to accept three input values from the user: * ^& z3 ?0 h* K( ~
- D2 t3 M6 P7 p& }& f1 T) d; K' r
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
0 ^" ?+ b$ L9 H1 g9 C; p- l# D. O4 l8 y" l* A
- the Annual Interest Rate (to 2 decimal places, for example, 9.75)
8 R1 k1 `0 i* Q$ C. A& ]) T" H1 t2 S
! U; l- `4 f# Z+ ~4 ` - the Period of Repayment (in whole Years, that is, no fractions of a year) , Y: X3 c2 D9 R0 y' q
8 s: w, Z2 u) o" d6 R! _' B 3. Provide a method to print out to the screen the three input values (accepted in
' B8 d$ X1 {# E2 J$ I requirement 2), plus the repayment calculations: * Y0 p% T6 T$ I5 o0 L' @
/ Y8 ^! S' F# `
- the Weekly repayments $ V+ q) A3 `- Y2 f
5 A$ @2 n2 S. E$ v' l" p
- the Total repayment amount (Amount borrowed + Interest)
. ]$ ]6 T+ f6 H' v- H% F2 e8 F4 G2 {
+ p2 E1 }9 |$ |7 E: r9 ]0 k 9 {" R. d% u! v; {
: a7 J# [% F/ u# Z( w. V2 Y
The Borrow class: (Total maximum 40 marks available)
3 T$ l; o/ F- Y+ f
5 V* x0 G4 S0 Z! u! ^. T9 |( u# ]( i 4. Provide methods to perform the following tasks:
9 x7 V1 n( L) M# @! J- B5 _' z0 {" Q! B1 R& i% A, e/ M
- to calculate the weekly repayments *** ' Q6 E5 x' J6 S! @
" r1 G7 w* T/ Z7 `% ]6 \% d
- to calculate the total repayment amount $ N! \8 P' p& G# r+ S
) ~5 l+ o& p" {6 B3 D7 W8 A
- to return the amount borrowed 2 D6 \: E1 n# i
4 o& U. r& u9 o2 } - to return the borrowing period in years % ]! s& b% \& O p. y
0 U# |/ w' I0 r9 }% i8 { E, v3 ]5 O
- to return the borrowing period in weeks 3 V9 q! H% j& G, r
! c4 b. c6 H4 ^0 N9 k# E- ` - to return the annual interest rate
: G1 |, f: v+ E X6 P
* S; Z! N8 E; F8 S8 d+ G# U - to return the weekly repayments
: H/ W0 h+ x1 P$ X
0 {- X/ U0 F1 a2 ~: q' w$ T - to return the total repayment amount
: l' Y/ F- B6 E/ K
1 e2 L6 W, w8 a( s9 O' w - to reset the loan amount 2 ^( Q" q1 }6 P/ s. I1 p- u
8 I* v* Q4 R2 _; F - to reset the annual interest rate
6 r: _! D; a* I J
+ O* h; b% a! { I9 y, M& U - to reset the loan period (in years)
; w, s- z Z$ o( N6 i6 T; o, Y T7 Z; j8 L9 U
+ K; t; n! `9 X& L+ t% _, }
, f( d$ E% x- G9 l, `7 g1 Q
& n: Y. D) i2 V# G " F! G; S5 ~! U0 ^2 I. z& @3 r4 j
*** Use a simple interest calculation (not compound) formula, for example: ) O; {1 s# M; E% m5 J
1 _* Z, a6 Q) J) A% w weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
4 j$ h8 v, Z6 F7 u. h# u( ? numberOfYears )) / numberOfPayments;
- q0 V/ k' ^: {3 C4 A4 A [
8 h5 m3 K3 X. i3 T
, {! f/ [6 y' ^) v: R1 Z1 J1 z f3 I% E5 z: m
5 n6 P2 R6 q3 z. V
5 S4 m4 _2 r0 C- q7 Y2 P
Individual Data (Maximum 10 marks available)
7 V2 J: I: c& K U4 e7 J% K7 o* r/ t
5. You will be given two Megalodon staff member user names and passwords, plus a set
% H- j) J, f& Y7 c' T I9 P. Z of data for each staff member to use to calculate repayment details. You will need to
8 Y( i$ ^9 e( ~; J0 v- y9 U6 S+ t log onto the BSA104 Assignment 2 page on Vista to generate your individual data
`( {2 n3 c G and instructions for this requirement. You will need to use your University of ( w9 ?! I& q& K- C! s
Tasmania (UTas) student number. 5 R. I1 R. K5 B
3 o9 S1 y9 q( h: H1 Y
8 \/ Z; A+ K' _ Page 2 of 5
* W/ c6 C+ y1 }( R8 J4 j' r: g" N: H
, n3 @5 L2 V FFor requirement 5 use the following data:
D5 l, |+ I R8 h/ C* y; j! v; ~
1 n2 e; K* M7 J7 b! Y$ u! E4 x# Data Set 1:
* n# q3 g7 B, F; @3 n) b/ P3 w
8 O: {( l2 E; J$ rUser name: JordanM) T! X& H9 _; y2 n& f |8 l. L" [2 _
Password: Ferrari
0 \( C7 K; v" J; xBorrowed: $ 749.95
5 i$ d' _* H l% J1 |% |! f/ S# w8 xInterest: 15.0 %' ]- n v, P s
Years: 4
* e. h& x/ V& x" h7 T( v: }. c$ B* D/ p9 L; x
# Data Set 2:. r# G% ^( Z0 y9 z' ]
' ]5 F2 V! u% V2 J' PUser name: KimZ5 j1 b) o4 v- {" t6 J3 l
Password: DimSim) s/ c7 v: F/ o# p1 F1 h3 Y
Borrowed: $ 150500.25
% U; a2 h4 H+ B& U9 yInterest: 5.5 %
y5 j* H+ U5 t. P6 gYears: 7 j8 b& G6 a1 b+ Z8 |( u
' @% P, o$ S# {8 M
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|