|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊7 m" U, P) ^! F( O) b& t" c) G- T
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
1 \/ @' i* Z( X/ d& @) J3 _! FRequirements:
4 q, k+ o3 u# r4 R- JConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
) ] R, C. g" j4 o {- g# a" rAssignment 2 page on Vista.
6 V" L! ?" Y) { % K: X) s2 n- [# z
You are required to perform the following tasks: 2 N9 a. N" W' w( X0 Y* @
# I% T- P' Z3 q( M9 f5 O) I
The RepayCalcMenu class: (Total maximum 20 marks available)
+ C% Z. v) b0 B. A9 _2 B
9 g; A4 s1 _, D$ r 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon 2 w9 \; D8 D' Q3 F7 C' y
Finance Company so that it can be used by the Megalodon staff members to " u& Y' C! n) f ]6 j- }* ?1 L2 m( k
determine repayment options for their clients. 9 `* s7 }( `( ~* }) {) z
# E R8 q0 N2 m: v. `7 x2 {2 ]3 ]& m The staff must be able to: 4 ?1 L% A2 E; c$ D1 q
& t/ [ f6 o- L0 k5 |
* Log on to the ‘system’ using their user name and a Personal Identification
" Q8 V7 k' Z5 }, P6 Z Number (PIN), which a four digit number **. 3 r% r7 `: o+ V* G5 _
0 Z* z# p- ^# T* F * The user should not be able to use the ‘system’ until they have provided the
j6 Q, }0 `$ M' z* z* e8 ` correct user name and PIN combination. You should give them a second or
( S1 |, ?* z& @0 l3 m% @ third chance to get it right before shutting the ‘system’ down.
) ?7 b3 h: U3 f+ l& K4 M9 F8 T9 N2 f6 V( g5 S
/ n! f& q; o2 _* r1 l
4 _ c/ }; x! A2 t3 {( T ** You must use the user names and passwords provided in your individual
6 b8 M& z( U' K
% R' y8 W/ m( [ data available from the Assignment 2 page on Vista (see requirement 5 below). 8 B0 `+ e$ i# q" r" ^, x
The user names and passwords should be included in your code, and the output 6 z4 x; A6 Z7 d' S. }# s8 O) S
to the screen should prompt the user with the user names and passwords (for 9 `$ M9 g3 Q! r6 I& y! ~
. d, w8 `3 b* e marking purposes). 1 E' F& Q1 j" }( y9 N
. H: e& s6 I. S' U* s) b# S
' F0 g# |! T: J. u
5 R$ Q+ i7 f" X% N; [: D* The interface should provide a menu so that the staff can:
- \! t4 V' V0 \0 E1 W- |+ Q7 A+ j' B) K8 @% r7 h7 B' ^
- Perform a Repayment calculation
* W1 U! Q+ s' E6 c4 d; B
/ @! K, k2 d( V9 [( u# M - Print out to the screen the Repayment details
1 Q/ u: ^7 x1 r9 W) Y# m y* I/ Y, A! h6 v8 L* w* d) g4 h3 S% A8 y
- Change one, two, or all of the values for the current calculation
4 ]; ?* t( R3 B( V8 Y6 c3 w9 X" y$ C& ]6 h4 |9 H* a
- Start a new calculation
7 S" k4 n* `' Z+ m$ u
" F3 O5 i1 T; q, q. Y; G6 ? - Leave the program. ( F- Z9 ?. g/ O0 r& G
The RepayCalc class: (Total maximum 10 marks available)
$ W. f1 _: j9 I( b! f% W: j" P. e% g6 m/ J& |
2. Provide a method to accept three input values from the user:
: T$ N0 ^: C6 r5 T. m! R
% j1 x8 z/ C* r5 B5 a9 L - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
' S0 w# ?' @# ]0 ^) S+ {
1 c* |& `% X" ^: e - the Annual Interest Rate (to 2 decimal places, for example, 9.75)
! G. b5 E! G' X; S; z4 X
4 e( Q# _. w6 j( F% ~8 t8 `4 a b - the Period of Repayment (in whole Years, that is, no fractions of a year) 2 h; x; K0 @: i& F# Y5 W
" a8 C; F$ P- V$ B' F 3. Provide a method to print out to the screen the three input values (accepted in $ b2 `( A- o' O( o4 a8 S
requirement 2), plus the repayment calculations:
1 o) M! I7 z8 d& _0 |7 E W/ [% a
0 u" ?+ W# ~3 S/ e- X* I. W1 g - the Weekly repayments
% `' k' b% [: P( C3 I
2 u0 W9 c" W4 z0 c2 P - the Total repayment amount (Amount borrowed + Interest) , B7 @; {% X' \& T" E0 ~# E
5 S+ ^& `' w, f3 G4 \ v, i, A
s( @* c: @" G; \* [' C
2 @% g+ h3 R. S% s) L0 n! H% `" {The Borrow class: (Total maximum 40 marks available) $ f# B0 i/ c2 o4 K
; T; M$ s( f* H% ^- Y 4. Provide methods to perform the following tasks: 3 z0 ]/ ~4 g& S8 M7 W* B
8 D9 I* a6 k/ E( I+ H: z. n' ~& ?" f
- to calculate the weekly repayments ***
# b0 a z+ Y9 q" p
: ^; u( Y$ X! @8 w2 R4 Q - to calculate the total repayment amount + a* A+ \! @2 A6 Z5 R
4 [8 m8 Z- {& y: Z. \0 U
- to return the amount borrowed
3 I. U2 v) E% ?3 X" m0 _3 b- A, t6 w* E- W0 b: a; R
- to return the borrowing period in years \) h4 { F. f0 H7 U% `8 F; V
: h/ N7 u$ H5 [6 Y. W - to return the borrowing period in weeks 4 D: h' K& a7 o3 E( h9 q- y
I& Z7 H0 j8 Y6 S) F6 x
- to return the annual interest rate 8 ^$ l5 e$ J; q# r
4 g4 w. B6 G, t! p& T - to return the weekly repayments 2 o" ~- X2 o2 p: M4 A# r/ f$ N
% Q! k0 ^$ ?# ]1 b# ~
- to return the total repayment amount ' \3 S1 d J. R. g$ M }+ O+ `
2 A f1 e- ^& A* r - to reset the loan amount
( _1 w2 D/ a2 b4 V1 r; X- i: ~& }4 n, j
0 k/ R) x. X. J7 t - to reset the annual interest rate 4 B$ K1 H+ S9 D2 B' B/ X% @* N8 g, e
- W7 p0 [) S' v% z S
- to reset the loan period (in years)
" l% z; k! e7 d* [5 p4 g! f5 p$ f7 J0 v4 X# e
0 P+ n1 `9 m/ `4 q( k
9 j7 P5 X3 Z9 c7 A! c, V+ M
+ j7 Y6 b/ J! Q7 c# Y 4 V4 M- y8 b" J( @0 e
*** Use a simple interest calculation (not compound) formula, for example: - F z! P3 ?# L+ O1 N, b
2 s8 Q; |( _1 g weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * " G: q9 M% N1 W% X7 \$ c2 F3 W
numberOfYears )) / numberOfPayments;
5 K8 i$ \6 M8 D5 X0 w
3 T/ n, R7 F" I 8 W& T& E$ e" q3 b* V. D8 b7 X' g* Z
0 S. i" E, C4 T1 z1 G/ x $ R# x# r y6 \7 L. b( d4 k4 L( h: [
( d( r4 L1 T" u3 RIndividual Data (Maximum 10 marks available)
6 H% H, H, y8 e5 W, }' a) t+ w# G$ \) B3 f4 f- {* W& K1 p. x; d
5. You will be given two Megalodon staff member user names and passwords, plus a set
2 E8 O7 U# g9 a0 w( a8 B of data for each staff member to use to calculate repayment details. You will need to
/ ~' T* n, l3 R7 X) f log onto the BSA104 Assignment 2 page on Vista to generate your individual data ' j' p8 ^$ `- P
and instructions for this requirement. You will need to use your University of $ l. F1 M& S: B# i2 _4 v z% _
Tasmania (UTas) student number. ( y9 h% L2 g& g
/ C! k' R% r" m
- n, c. Q5 w5 k' } d4 R$ ~& P Page 2 of 5
( w" ^ m7 |2 `8 N4 Y. W* z' _9 B- f! W
For requirement 5 use the following data:
) A. L I+ d: N' v' l6 Y8 u& G. I0 s7 P5 s& x9 |! t
# Data Set 1:
+ z, R7 Y9 I" B3 y/ w, ]
! A3 y+ ~. `' _' u; a+ N ^User name: JordanM
) c3 w3 ^# w3 x* Q( \( jPassword: Ferrari/ C g" J4 ?& |9 n0 ]4 R9 P0 \
Borrowed: $ 749.95; }) C0 G* Y% b* U2 L; M$ a
Interest: 15.0 %
! N1 A( s$ G T- i2 z# X3 mYears: 4
" _" Z5 n# w7 y- S: a* t
7 j* g2 }$ w6 d8 M! M/ F1 ?( W7 l# Data Set 2:
0 D: O2 l( y7 [1 K
- Z. i! y* b5 g- G8 o- H- lUser name: KimZ
- `* w: G$ d7 A# B! [$ [7 Z: PPassword: DimSim5 F4 }' h m6 f- _
Borrowed: $ 150500.25
( F( Q& N) o3 H+ M+ gInterest: 5.5 %
5 }1 x9 |% ] A6 s3 q) U+ UYears: 7% m6 A& ?+ i, N$ I3 x+ q
8 y8 c' i, Y( ?) l& j3 ?[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|