|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊# x3 {# w" H6 D. e
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
. j+ @! I, P- _* v1 sRequirements:
9 Q1 m. X; B6 [8 ?! B; \Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the - c# M0 @2 o( t' W4 k3 c
Assignment 2 page on Vista. ! v* q4 i! P6 W T9 _6 w
" P! B; I$ q& v( P; |" {2 J& G
You are required to perform the following tasks: ( P+ P/ u) _6 N. ~5 ^& f
" n7 g' C* m2 X1 a3 zThe RepayCalcMenu class: (Total maximum 20 marks available) 2 t# L5 n5 y8 ~1 K8 H9 n: K
4 d/ k4 [5 G. v) `1 T
1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
6 l# ^* V, L$ ]6 H! J Finance Company so that it can be used by the Megalodon staff members to
- O% b$ ~ E. k- M# {1 a4 G determine repayment options for their clients. , r- p- [3 y, i3 L- W
$ w3 M& N: k: `$ e, U* J2 K
The staff must be able to:
6 a% z, P( T6 J- _- b% ]& Y0 G' t6 G: E
* Log on to the ‘system’ using their user name and a Personal Identification , {& F7 e$ i/ ~. `- Y
Number (PIN), which a four digit number **. ' ^. u7 |2 z' r0 i( x. _
& r! y( H8 Y: i
* The user should not be able to use the ‘system’ until they have provided the
% b: v8 E- m: m0 P" s% v correct user name and PIN combination. You should give them a second or 8 k/ R& V9 y6 z; m
third chance to get it right before shutting the ‘system’ down.
! W% }8 K# Z* U. z
9 \1 F1 V1 S, y. U& C & H8 V/ t) {- j5 Y4 f
3 J: f8 ~9 C5 ?" B& u, j. N
** You must use the user names and passwords provided in your individual
8 L9 l* ^# A1 q7 ~- H8 T
, _/ d! P3 }1 ^ data available from the Assignment 2 page on Vista (see requirement 5 below). . Z, h5 Y$ {1 H% `
The user names and passwords should be included in your code, and the output
, V# q# _- {% |" E to the screen should prompt the user with the user names and passwords (for
% U% l6 q( ?% B
/ O2 J. A: S# I( t) z* D0 D marking purposes). 6 q! q+ P9 H$ {) t/ [0 K
' O& ~7 c) G- `8 r: F! W& E6 i
8 K# Q) ~3 S8 S: k* @
" T* t8 f& J2 R3 r1 ^! R* The interface should provide a menu so that the staff can: $ M' V6 C1 F& ~
6 N" D% {# S7 [$ p$ x& s
- Perform a Repayment calculation J" b% ~& [# M9 T+ a+ i' P
& o2 j, c- {: f3 T0 c4 F" v' E* V/ n+ J
- Print out to the screen the Repayment details & H. D$ \: l7 x$ w" W; q4 T& ]4 t
4 k, h- i4 ^9 d7 o& i
- Change one, two, or all of the values for the current calculation 8 |/ ]# Q. f& [4 n
1 h7 K* g. e/ D2 l- z- o' H( v
- Start a new calculation
* }* W: k* d6 N, H8 b2 |: Z' O; N1 ^: k. v: j" ]& B- w- z i
- Leave the program. ' G6 _7 l, W. X0 r) J8 X( ~/ m
The RepayCalc class: (Total maximum 10 marks available) # W8 b+ l) x7 W# ^
( J) l) y( w" I
2. Provide a method to accept three input values from the user:
5 n& z# }. C( ^5 n! P- O/ M$ H3 }6 H( W. ]' D2 ~
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) 3 W4 @% r7 W6 O0 \
0 q# p8 @$ j6 I G4 W
- the Annual Interest Rate (to 2 decimal places, for example, 9.75) 2 N- B# X2 e" z6 b
# K: W' ^# m: s! r
- the Period of Repayment (in whole Years, that is, no fractions of a year)
% j1 ^+ ?$ F; n9 E: J+ |0 k0 \* u! K+ q6 f8 o2 H2 x# B
3. Provide a method to print out to the screen the three input values (accepted in
# D* B( }; V2 d requirement 2), plus the repayment calculations:
% U5 m+ `2 n4 ?6 y) T
3 n) ]/ H& e& I+ l6 p& Q; k - the Weekly repayments
5 g# X3 D ~8 l; f1 @9 s2 l
0 C3 o4 N; @% D9 t - the Total repayment amount (Amount borrowed + Interest)
) v; }. i5 V2 F, ^3 p2 Q/ R
4 Z* G5 c; y( W& x
7 W$ V- Z) z/ o" o1 K* A! t7 v% V
' n; Q4 x- K. Y" f+ xThe Borrow class: (Total maximum 40 marks available) $ c8 _3 g `' s7 D* i- V
8 E" C/ w5 h0 l; D9 P; d3 W
4. Provide methods to perform the following tasks: ( z. a7 a0 Z! V1 E+ L. x
& d5 s1 E. u7 H! m! s2 ~ y
- to calculate the weekly repayments ***
; J7 u, P* }1 ], K$ E+ J
. o- v% K r P2 ?2 @- U1 B; F - to calculate the total repayment amount
; q; J$ a- F) ] X: x. |, w1 [# H* L, t' {
- to return the amount borrowed
; c6 v# _/ L+ X
$ w" w8 ^; H6 N - to return the borrowing period in years 5 R- q) N" w" } ^* B1 t5 S
5 q$ M8 l7 k* r- J; \# L - to return the borrowing period in weeks
) x: }$ n, j8 H) Q4 n; [9 {# m- q6 S" s. J2 b3 R' _
- to return the annual interest rate ) B6 r. D% j5 F3 u9 Q8 i0 ?
& p5 h$ h4 c3 f* X! O7 X
- to return the weekly repayments * _$ X/ V$ w, s
4 D* h0 [4 T9 X7 ], j' i
- to return the total repayment amount
; A8 r: S: u# c1 C, L' U
M& G; n+ M) N$ y( \5 x1 H - to reset the loan amount 4 g L* E( B4 G' _1 _% U: l
+ y- |. W# h* P% N) R9 \) i - to reset the annual interest rate : _1 n/ c" y$ x9 q
S {; W5 t& S, S - to reset the loan period (in years)
* q1 J- X; b7 R7 K7 F$ J9 G x* y' B; C. z: J
. `' a; T* M+ ^$ J' I- [( j$ o
$ u" W8 ~: r) N' N$ m3 H ! q+ r% n* \5 B# p" u) d8 Y0 T
6 o5 _/ @" i0 p6 Z7 @9 Z
*** Use a simple interest calculation (not compound) formula, for example: 3 H: [2 I4 ^4 _: [) A
0 e, Q/ d. A; Z a% N weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * 8 ~; W4 o+ q, x# F1 X/ g9 Y1 V
numberOfYears )) / numberOfPayments; ; e1 S5 p4 Q$ a
. C% R5 t5 z9 N* S) d
$ f5 N8 Z2 \0 W) y, t, y9 U; S8 l# i' N9 f! E
3 p3 x' r1 J* c5 |5 K1 H( o# D
0 c- Z# \, e7 y; r& U1 jIndividual Data (Maximum 10 marks available) ! m* h, W2 L5 V* _, [- h: g3 r1 m
3 Z5 ~* q; v0 K' I* j) v
5. You will be given two Megalodon staff member user names and passwords, plus a set 1 ^3 g+ h$ q& l. z# P; U
of data for each staff member to use to calculate repayment details. You will need to : V- k6 o0 C# d, M7 F$ |
log onto the BSA104 Assignment 2 page on Vista to generate your individual data / T6 `5 W; N, ~7 R2 X0 u
and instructions for this requirement. You will need to use your University of ' X3 `' u4 {9 [" I
Tasmania (UTas) student number. ' T! S4 L# x$ {, x4 J5 q! P
' V' ^. W- E1 V1 J o0 b* ]
4 A T4 a/ c7 U+ t+ x2 o Page 2 of 5 8 b$ g5 U: _9 W" \5 ?5 i
" B, H- Q# }, f+ O! U: \For requirement 5 use the following data:
1 c& [& y1 K' m( I3 |/ L: V- v- M8 v; t0 t. j2 H
# Data Set 1:/ q1 C: R8 W4 Q' I) {* h9 Z5 N* S
% C! T1 q$ V" g1 s1 q gUser name: JordanM3 Z8 I: h5 n& a9 A7 _7 y0 y* Y
Password: Ferrari8 |4 j1 d& v% k: N: l" q2 s
Borrowed: $ 749.956 `- J4 h* n3 {# x$ { p3 {# F
Interest: 15.0 %
1 e5 U; n# W6 r2 A7 F. m/ c. q5 ?0 lYears: 4
" e* `. E2 D: ?4 A% R0 D9 E2 z g" b9 p
# Data Set 2:
0 T) ~4 o- m2 \
) w) x( c2 W4 ^# d$ d( h* NUser name: KimZ: r6 Y4 Z4 [4 Z5 Y2 x8 O
Password: DimSim/ ?- D4 W: i. Z9 Q; [
Borrowed: $ 150500.250 s' w! H h \! P O
Interest: 5.5 %( j% D: g0 F8 ~
Years: 73 d3 y" F) G; j2 S8 I
6 t7 D& b2 U4 l- u# ^- I[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|