|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊$ ~; Z9 S. U1 K, q
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦! }& Y) [/ g' s U
Requirements:
/ D4 v- }: b8 R* r# O, iConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
8 O. Q( [% n# {! K. AAssignment 2 page on Vista. . J* Q% F: |: X$ `" m
2 ?; y8 V, E; Q; N& a1 y3 D- s
You are required to perform the following tasks:
5 u) w/ U( |3 k* n- m' R 6 e/ v% `6 M5 w7 V
The RepayCalcMenu class: (Total maximum 20 marks available) & d+ u) P# Y* X; x
+ P& G6 P; \- l. v& v 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
7 R7 d& y2 g Y Finance Company so that it can be used by the Megalodon staff members to M: P, [6 H. l# x ^/ v0 T% C
determine repayment options for their clients. ) f4 l9 N0 ?5 v0 s* J/ S% M8 Z
7 v' ?% I- w1 n* v: k( P* @* G The staff must be able to: / L0 r6 d0 k6 A' a6 K% m) b
% Y: C0 Y3 [& e* C4 ?) A( e
* Log on to the ‘system’ using their user name and a Personal Identification ( E d2 w2 a8 O0 q u+ D$ R; E
Number (PIN), which a four digit number **. 9 ^% p2 V/ N# Q; q6 x# x1 j
! `" `" T" p* f# G% E5 h * The user should not be able to use the ‘system’ until they have provided the
; \! `6 n) w8 @7 p9 Y7 g( ~7 U correct user name and PIN combination. You should give them a second or
; s# Y7 r& G) N third chance to get it right before shutting the ‘system’ down. + I( A3 u/ z9 u# z5 k, A
* z7 }, ?$ n1 @) W# G , j- O" H, w8 S I
! L! T) y& b* |& r# k* F2 ?0 D& G ** You must use the user names and passwords provided in your individual
V7 }6 m2 M1 j( Y# U* Q! t" W! D z
data available from the Assignment 2 page on Vista (see requirement 5 below). 2 M' ~/ t8 A' r5 d; f/ ^
The user names and passwords should be included in your code, and the output
" ~% _ }* P* N; A to the screen should prompt the user with the user names and passwords (for
8 h8 F. L1 E& n& N! M- @$ i0 f( y1 N! ` ~9 w5 W
marking purposes).
& n2 z6 N* s$ q8 s: F8 T) y
8 ~2 ]2 B1 ~! v4 F ) p# t$ [' |( p) L1 F
5 V; `( i3 O* X2 H) E1 a* The interface should provide a menu so that the staff can:
' Y0 M: ~6 a/ n2 {! }7 P; ^/ }
$ O0 z+ e; c1 { - Perform a Repayment calculation
8 D S& p& t# ]4 W
% O' [7 i" j) T9 ~ - Print out to the screen the Repayment details ; `1 i( t) @3 \$ ?
5 w; b0 g" o. B3 U+ q - Change one, two, or all of the values for the current calculation " j, G, m8 y- l
, j) h/ W6 f/ J) o2 f - Start a new calculation " e& u5 Z7 `/ B3 p l! ?' Y
! N' U& v* \1 f8 Y4 Z - Leave the program. 4 n7 H) }) O# f+ v
The RepayCalc class: (Total maximum 10 marks available)
" U6 \' C% [. S, {; d; b! F/ N4 h' N1 O; {
2. Provide a method to accept three input values from the user:
8 Y5 Z" q/ V4 \0 S6 p1 K; p) q* _2 E
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
# h2 q8 ~8 B8 M* o& n4 f! O$ C# U4 E/ i
a8 W9 K: T1 S! x+ r- a" |0 J: L - the Annual Interest Rate (to 2 decimal places, for example, 9.75) $ J; D* P ]' p/ m+ o- _
' q) U3 _8 l. u [+ S- F5 o$ c/ |
- the Period of Repayment (in whole Years, that is, no fractions of a year) ) N B/ @& `3 G4 N
! _+ j' ]% f1 @, L4 t& N
3. Provide a method to print out to the screen the three input values (accepted in
6 i$ i! H6 F: V8 H8 h: U) l& i* x requirement 2), plus the repayment calculations: % l% U9 v; f8 ~, O4 y" x! t
5 F$ D$ C; B* E' e _# Q! _
- the Weekly repayments
0 a) k, v M; F9 n1 d1 W. T* k; [8 h4 \- k$ z
- the Total repayment amount (Amount borrowed + Interest) 3 L9 u# W4 D9 E) }+ `6 U
! ^- U; o( |( X% M; P
; H6 j2 a. E3 E7 d" k
8 ~% M, K* x2 e4 S# G7 j1 ?! a1 v3 pThe Borrow class: (Total maximum 40 marks available)
' E2 w2 t) h7 t$ s! A( u$ X2 ]$ n, K/ U& ?$ j3 X6 T* y
4. Provide methods to perform the following tasks:
) p' v% A4 p' t5 {% g+ |2 L# n% S8 I0 Y! o S
- to calculate the weekly repayments ***
6 B3 B- q+ L, H- A. g1 W- h
6 ]) D& O* y! V - to calculate the total repayment amount # r6 n. [) M2 y2 t
6 q0 K& c' W9 [ - to return the amount borrowed " V" o p% @. k9 \" Z
$ l2 J) D7 }3 [/ A! v
- to return the borrowing period in years
2 j# H* ~/ t: u6 v. E# n
, G- i5 o# W% F# E - to return the borrowing period in weeks
3 r2 G/ f9 `2 I8 \% q& X& d, k( F; M' _6 y' D
- to return the annual interest rate " @: e. \; D% s# i& }& o* ~6 q* c
! M" n- U H% a3 x% z4 M2 u" N - to return the weekly repayments - @" k% U/ N- k# D
1 n! X! U! K2 ~1 _( m2 C - to return the total repayment amount
0 a( c8 g) @: `
8 q1 v, m, t* J6 ^. c! X - to reset the loan amount - ^& X# E4 {* {; w+ H
9 Y" A5 F/ P6 [; M, E - to reset the annual interest rate ! e0 N$ k% L8 D: P
) v, j0 a/ [) _ r+ f4 p1 B1 {5 Z
- to reset the loan period (in years)
0 r; {' D1 `( Z7 e( S1 e E, S8 L% X8 e
- z n3 C3 y4 ?! v. T7 a: t9 {4 ~
2 U& {2 t0 E" a* [ % ?7 p( q. |& m# X w7 p+ u* h
0 M6 V2 Y6 X3 }6 b6 J* F9 X/ q7 n
*** Use a simple interest calculation (not compound) formula, for example:
" }2 D9 H( y8 j( s: z 6 v& c# t, d# }! }
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
6 \2 W0 Q5 Z4 f7 f9 S numberOfYears )) / numberOfPayments;
6 ~# S5 z9 }; z) @3 F3 J# h4 L' { E+ F& M
; o& H, p- m1 G! d% b$ K2 \& U5 t9 U. e
! ]7 N/ K8 E; l4 r5 X
0 g" p" j. B' @& y8 P9 a+ m. pIndividual Data (Maximum 10 marks available)
9 W: @. `# s: K, L6 y) r2 T7 v% U+ J
$ y, ~" F/ [/ o2 A 5. You will be given two Megalodon staff member user names and passwords, plus a set
, f$ H) D5 c! W) N& c% l of data for each staff member to use to calculate repayment details. You will need to 0 u9 }! Q6 _2 w# T* O6 N
log onto the BSA104 Assignment 2 page on Vista to generate your individual data
4 o* Z5 ?1 k2 X; h6 f and instructions for this requirement. You will need to use your University of
; ]. V. q1 _8 \' m; @/ n3 y1 \3 b Tasmania (UTas) student number. # p7 c+ S# k% M0 S7 i
3 W$ Z9 O8 H7 y+ c( z9 e/ Q- S
# d" D0 B* W) {' o; T
Page 2 of 5 # {$ ^ x) f8 L* Y! g, R4 Z
5 D" T2 C$ E. L% b+ b D6 h
For requirement 5 use the following data:6 Y2 R0 A" S1 P6 e# _) b
: Z$ b& a% L+ p$ i, `# x# k# Data Set 1:
+ ]. _- T( g4 ]6 W) r6 Q% f' ~' b; E$ K) y/ P7 E: w' h
User name: JordanM
7 G/ I5 ]9 C9 HPassword: Ferrari2 i3 y5 {+ b* E9 k, Q; V6 V. X
Borrowed: $ 749.95
/ b" n. m4 |6 i; b2 AInterest: 15.0 %
* t+ _- D, g6 _4 jYears: 44 i/ q3 ?1 q" v) U/ t- T
$ s7 o, u1 b+ [
# Data Set 2:% I% M" H5 x# S, K9 m. F7 l
[# Q! T9 f; Q% PUser name: KimZ1 V- r' n7 P. y0 I3 H9 G2 @
Password: DimSim
3 H7 K# g8 I A* i) Q3 `9 H1 L: fBorrowed: $ 150500.25
- M: F% {) S1 |) j9 HInterest: 5.5 %& i" {) X, B! p5 C, N* f' d- U
Years: 7" ^" y1 D' ~3 J. G
% l: Z& ?. V. B
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|