|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊( V9 o" h9 F0 H4 K0 s8 x
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
; C& h% a& J0 L% Q6 {* cRequirements: : y. X% z; k) \- n
Consider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
7 [! a: x7 \5 b! P F8 qAssignment 2 page on Vista. 9 w1 c- m" [+ |3 V0 [* B& U8 c
! f6 U; o( v& H5 k4 a* K
You are required to perform the following tasks: 5 ?! U8 v, d8 f& x
' G, D L/ E8 n9 I* oThe RepayCalcMenu class: (Total maximum 20 marks available)
% T& n2 G2 ?: g- G
N2 u1 W. }2 b' B2 l 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon $ A+ [& p: Y6 x8 q9 A* s
Finance Company so that it can be used by the Megalodon staff members to 1 e6 K+ z! z$ i
determine repayment options for their clients. 4 _2 f" z% y9 i; O
2 @. ]/ ~" @4 v1 o$ a! f The staff must be able to: ; J& U8 Y7 P, J5 G4 U" j
. i( s% _; x T9 \' f6 ~
* Log on to the ‘system’ using their user name and a Personal Identification
; [( F1 g6 A# @" E% ^ Number (PIN), which a four digit number **.
! w! p5 H1 x, c3 ? ^0 B$ s/ O, d0 ^5 c4 J L: Y9 ^
* The user should not be able to use the ‘system’ until they have provided the
6 j% D" E% _, Z' H8 g6 B correct user name and PIN combination. You should give them a second or 9 C1 G/ j8 A$ e; ?2 |: b
third chance to get it right before shutting the ‘system’ down. 1 l; L; s) H6 K- g
1 N$ A% h9 O% V4 Q6 M
/ M/ y' i: I7 ^/ r" ^8 K7 f : L3 S) n0 Z2 a' {
** You must use the user names and passwords provided in your individual 1 [1 o6 ]" c; _; q- ?
7 y l* I; g% l; i7 Y3 o data available from the Assignment 2 page on Vista (see requirement 5 below).
7 z2 e7 W7 U. B# m% n9 y1 ~# o! U The user names and passwords should be included in your code, and the output
8 Z: X# O# o+ [0 D* V3 X7 w to the screen should prompt the user with the user names and passwords (for
& f# m6 L0 v6 `2 U# h% K/ x
% P$ L/ t! [& m' @. b, [+ k marking purposes). 6 j& j2 D9 c2 t& D/ R
$ s" r% d$ @0 E
0 ]% e8 T8 n( t8 X" p. c
+ Y" [$ E/ |8 _$ T; f* The interface should provide a menu so that the staff can:
3 `+ c) i& Z1 g+ j1 U) Q$ D- j; M' n2 T2 g+ Z3 e* H& {* R8 J) j% f
- Perform a Repayment calculation : R$ X) w# b9 P* m- K# L% O$ F0 R" C0 B
4 o6 Q# ]+ L B
- Print out to the screen the Repayment details
/ @" S( |( E1 a1 X0 a- c; w* S1 b f1 ~
- Change one, two, or all of the values for the current calculation , G5 x; g+ R8 M8 ~
) G, b2 X [* D6 ~& k4 z4 t* {
- Start a new calculation
6 T) f- K3 r+ r5 n1 b& N& \
1 d. w0 }$ } M( \, R( u - Leave the program. 7 x8 m5 W* d4 G k$ {/ O3 J
The RepayCalc class: (Total maximum 10 marks available)
9 Z4 P( N s6 v8 e7 `' a7 I0 Y: d( n" I
2. Provide a method to accept three input values from the user: ) V6 s# C% w) X: T; H8 Q1 X
9 `: U- A% a ~% d( c- l - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
. }% X9 p8 ]; o0 _& f
x# K3 X. i8 O) \ - the Annual Interest Rate (to 2 decimal places, for example, 9.75) - W4 b% u8 Z7 D( L' |
5 y+ q5 D, h7 W" o' C - the Period of Repayment (in whole Years, that is, no fractions of a year) $ p( i- q; u, h) I) N
0 `* h0 S5 B( E9 R P; s) @
3. Provide a method to print out to the screen the three input values (accepted in
- H+ d) ?, X) a8 j% p$ s ^ requirement 2), plus the repayment calculations:
7 Y* I6 [8 O% X+ M! u; \( U, ]! R/ S0 T9 J* m1 q
- the Weekly repayments 5 `7 h0 V, |: F7 n$ d
3 y# Z" m8 U! |+ E; v& E- V ~6 B
- the Total repayment amount (Amount borrowed + Interest)
( O" X6 T* |1 q# G% \7 t" b4 O9 ^) t) Z( v
! @6 C6 k1 i7 o. w0 k3 U
" G0 W5 _; D6 k- F! NThe Borrow class: (Total maximum 40 marks available) 1 A; ?! D) k- c1 {% v' w
% g" H! I0 @6 t
4. Provide methods to perform the following tasks:
: o. ^. @" d% O! S n
r! R: f5 U; y( k. V5 W! Z - to calculate the weekly repayments *** & C- l B6 P8 b5 _
$ k( ~; t+ q8 l - to calculate the total repayment amount - |- m( `+ R' i5 v6 C# Q o
6 i% f4 M" r; y' a/ f
- to return the amount borrowed
, r- b2 N( y0 |0 o* z
$ x; o6 Q; o# |" L0 \& ~ - to return the borrowing period in years
- t+ `7 K) c* N1 k( z1 M3 _+ d0 |2 i; S/ k; P
- to return the borrowing period in weeks
$ W: }! o- z3 K C4 E" J8 R
0 E6 A( M- c, k, _9 R - to return the annual interest rate
/ P- g1 i1 C2 J5 ]: Q* k; b
; m6 H% b9 D& ~7 M( I9 u4 C - to return the weekly repayments 5 G9 S- H* x5 C& N" I& `
( v4 A/ Y( p8 M6 r: W7 c; z: N' ` - to return the total repayment amount
9 A1 J9 z# b5 S: M# ]6 w
, N" I+ \3 Q- l0 V# }1 t - to reset the loan amount
) P5 b* a1 H+ X- p# ^: n3 A$ q$ [$ Q# S& P
- to reset the annual interest rate
: G6 K( P+ \( W$ i" Z6 P3 h$ f2 _$ S- o
- to reset the loan period (in years) # Q2 z* d. @% N3 \
" W$ W/ J: N8 v6 H
+ l X) U- L, L/ C4 T6 c( a R# P6 `. [/ R {# t
O% T% o1 m' g+ @9 A, }* _% j
# Q, j* R( _% I# G *** Use a simple interest calculation (not compound) formula, for example:
/ H# G$ A' Q6 M6 T * S7 \3 ?4 Z* y( |
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
# n. X. k4 S' F8 v numberOfYears )) / numberOfPayments; 8 [ ^' r. H7 I' K' l0 [
( E3 @9 N5 R9 X0 w& j; L/ ^! j
6 \, B b/ r$ F) }/ K" W, j3 ]) q) _+ t9 V2 G
$ j$ D$ i4 E; V2 r3 `8 o- E7 U& w( G& d0 e# J! S
Individual Data (Maximum 10 marks available)
0 o* v( r. c0 E( b' C( P8 ] e
" d! N2 i* Y6 |9 ]& Q# J, U" ?* J# X$ {! F$ t 5. You will be given two Megalodon staff member user names and passwords, plus a set
, {% I5 d$ n' n, _ of data for each staff member to use to calculate repayment details. You will need to : ?' a; T6 B3 |3 b+ ]2 y3 w
log onto the BSA104 Assignment 2 page on Vista to generate your individual data
9 J. \4 P1 r3 b( F Y and instructions for this requirement. You will need to use your University of
) z4 r' k/ V3 X; Z Tasmania (UTas) student number.
0 n; W* a# A( B+ u/ F, A
5 x _" v- b$ ]; M; w l( n8 i' [' M: q" I5 W9 @
Page 2 of 5
1 q8 h8 U0 P: T$ A, t2 y1 F5 T6 H* F8 g1 ~8 k8 r' W
For requirement 5 use the following data:7 @# Z F) G4 R) {1 Q5 Z% b
1 L' d2 H& X1 i) K8 }8 T# Data Set 1:5 E7 U, m1 v0 r: @4 z( e, F9 N
( _6 B. y% G& v6 q6 BUser name: JordanM4 ~; l( T* @6 i& s
Password: Ferrari& U6 m7 ^) v$ t8 ~2 l: u/ Q* l$ o
Borrowed: $ 749.95' W4 @/ W& M, o7 I+ Z6 B) k4 q
Interest: 15.0 %9 K# ^2 P& R5 S0 j0 p% Z* b
Years: 4' W' y0 D: N; z$ j, F
) d/ i X8 r7 ~+ Z6 Z# Data Set 2:
* X1 Q; a7 ]/ T& h1 p, }* v. G. r3 D7 P1 ?2 {2 I; Z8 s# W
User name: KimZ! f. Z1 Y' O @+ ~# I$ p
Password: DimSim. |* P$ E7 |" w3 h8 Y5 A2 o
Borrowed: $ 150500.25
' B( z2 o- h) o8 r& _Interest: 5.5 %
5 a8 @ M) l3 d- Y# T6 V6 r& ^Years: 7' P; }, N* j3 A% i! c
6 _ S; C' [" J4 Z- M6 V2 o
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|