|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊6 A: v' M2 n8 G+ O! b! \
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦$ @$ V8 x* M _6 L7 e4 b; W- x
Requirements:
3 |) S' v, u. ?1 x; X4 ?; J6 I" cConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the 4 t |- @7 T; e1 E& R
Assignment 2 page on Vista.
! v* [# t t/ d2 W 3 m( y( Z g B% y
You are required to perform the following tasks: - B @- H# A( A4 i
1 C0 {4 E$ A; k9 r
The RepayCalcMenu class: (Total maximum 20 marks available) 8 q& _$ u# |/ n. ]! x/ Y% l! ?" m
d4 C* w O9 S% L' ~
1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
; m! T: x6 c3 G* b9 V, s" Y Finance Company so that it can be used by the Megalodon staff members to
1 W4 M6 _; T4 k( }9 b determine repayment options for their clients. 2 q1 F+ F6 r8 P- K9 S# G
8 p4 [/ }0 j6 x7 c7 u
The staff must be able to: 2 c* L: c) W. ?
) I) O9 D/ w* a d4 C4 J* s
* Log on to the ‘system’ using their user name and a Personal Identification / x* O! C: ]5 b& t% H! Z# V
Number (PIN), which a four digit number **.
! B9 |# q' T& E0 M1 o" p o r# j& z: s0 Y" g
* The user should not be able to use the ‘system’ until they have provided the 3 H% u% {1 y! C/ @6 R/ S
correct user name and PIN combination. You should give them a second or
/ `% {/ f6 r# A$ z d third chance to get it right before shutting the ‘system’ down.
. Z. H9 f8 A% s9 y/ T" F4 j( d& r
+ \4 B/ T" }% d* L" b: e" @ - @8 u# B! a2 _5 W) c/ O) x
** You must use the user names and passwords provided in your individual
! m8 H; \% ?- {8 w9 m
3 Q6 G0 _7 `6 `* X% v6 }$ M F/ D3 e data available from the Assignment 2 page on Vista (see requirement 5 below).
7 G5 D$ U! K/ y, A The user names and passwords should be included in your code, and the output
2 V+ ]# d# }8 Z7 B; v to the screen should prompt the user with the user names and passwords (for
0 ~# H. p. B9 E7 E+ u
; c X) L% _1 B. v8 L* x marking purposes).
Q( T9 O# t, X0 E7 ~
' D+ F. x2 X5 y( A% N% J# E; T
A E0 `2 O2 D5 r# ?( f6 d & O- B3 z3 Y; _& h6 |+ m
* The interface should provide a menu so that the staff can: 0 F$ c0 }, k# ^; X `
: }' S, A: X8 }3 d2 G" @( F - Perform a Repayment calculation
$ d# f S; @9 t( J0 d. j
! x9 q0 H2 }7 F - Print out to the screen the Repayment details
8 x I0 _' u4 v& a! ?1 [
- k2 {$ ^3 U5 K0 J* Q) r - Change one, two, or all of the values for the current calculation
6 Y3 Z- S: M; s7 [2 H! y2 Y: y$ h4 a: D5 F
- Start a new calculation
. B* c1 N8 t! A. |: p
3 l! N1 Y x7 P( e, w X1 A/ A' W - Leave the program.
- f- ]- O$ T+ B2 p$ a7 mThe RepayCalc class: (Total maximum 10 marks available)
* C: C; }( x; I/ D& i; |2 M/ [
; i9 ]8 z# \4 U( ^. K 2. Provide a method to accept three input values from the user: 7 h5 J% y. z6 t/ u* _% A
$ |0 A* J( Y: e2 s - the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) , J% d5 q) E2 H
, p4 m( ]' [0 u) B2 ?! W. k
- the Annual Interest Rate (to 2 decimal places, for example, 9.75)
8 S7 d3 @. u" b* y5 E' o! t" ~7 S _; i( \, V: P
- the Period of Repayment (in whole Years, that is, no fractions of a year) + G# x, b9 l1 n' A+ M* ]
% Y- d J, z' a2 r& T/ x# M
3. Provide a method to print out to the screen the three input values (accepted in
+ b" J: @' E# ^' V, a requirement 2), plus the repayment calculations:
+ \3 h! j. U. ~' q2 d: a" N! c, W7 _
- the Weekly repayments
. }. W- Z c$ Q% }- h- l- {
/ ~) ~( q9 O. w% H% B) ? w, l- p - the Total repayment amount (Amount borrowed + Interest)
& Q0 l' d/ b3 K# F# c0 a# s' |0 Z6 R0 r7 x) j- y( O9 V: m2 A2 J
- d2 S+ V, g7 |0 x5 l: I! i3 Y I
! z7 m K5 R& i! r9 t% _
The Borrow class: (Total maximum 40 marks available) & n1 Y1 C8 i# l
; j9 v) p- @! z) X; W0 D g G 4. Provide methods to perform the following tasks:
! i. `# \2 g2 ?" i1 Q+ L
5 I" s5 d$ x' W" Z: o - to calculate the weekly repayments *** _; \0 t. e! n& V/ u5 @" z7 N
* |1 v* s* L ^- }: S8 O4 b; v
- to calculate the total repayment amount
$ f, O; W$ r: w& g) k3 E) j
1 H( W4 @& V9 P$ p - to return the amount borrowed
' Y, M( I8 e% S* a
% I9 o& J# V0 {: x - to return the borrowing period in years 5 o$ C1 q/ h$ p' C, ^
' J; z) {3 d Q/ y; Q# Q: E$ B
- to return the borrowing period in weeks
Y- _8 v) U! r; f# r$ Q, I$ M+ d9 D8 M
- to return the annual interest rate
8 Q( D3 ~3 Z( g4 n& G
4 v9 R- [! L" a- i) K - to return the weekly repayments * B8 @' i3 W5 k3 T2 C
9 x8 d; Z3 U( e7 C3 O9 F
- to return the total repayment amount
, q0 B8 t% ?, Z6 Q1 H# q c+ b. u/ E4 p r* O1 F- {4 i
- to reset the loan amount : M9 }; Q& c( Z; x- m7 Y# t) ^
! O/ s- F4 x7 b* g9 X - to reset the annual interest rate
" [! |+ f. v. e' Q* Z7 J4 h
) p# P; o- [- |2 d( J d# N - to reset the loan period (in years) ; }7 n$ C# H' L3 s. r
6 n2 {5 T1 z, _$ A8 B8 P! n
5 K/ ]8 f! v* u7 q1 _( P$ Y; K6 g% a% f3 m' }! X% D! F& z o
8 \* a: N3 |% i. S
0 C# `' s& H6 g5 y6 z& `
*** Use a simple interest calculation (not compound) formula, for example:
9 D! ?6 |. t1 g3 H e# O1 @% b9 ]. r
5 l: o+ K0 o% H/ K" E6 s7 z weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
2 l7 h0 \! x4 n2 M& Y7 s numberOfYears )) / numberOfPayments;
6 d- ], } G9 V5 s: q. h
" B2 w7 `( b8 s3 K* ]9 f
0 t! w% t3 {+ I2 a' v5 d9 ~8 [3 f. a/ s/ e# S- S" }
& D& |' j$ A* A8 ]1 @
F; v2 O9 p$ d& AIndividual Data (Maximum 10 marks available) * U7 ] F0 p. O4 L! h* j" x( I
$ g$ [* t! x! A: b# z+ M* ^, }
5. You will be given two Megalodon staff member user names and passwords, plus a set
: \- h9 t0 W; M/ l4 S8 U. w' y$ S of data for each staff member to use to calculate repayment details. You will need to
) `+ p8 Y- | E4 v) d- Q log onto the BSA104 Assignment 2 page on Vista to generate your individual data
) f. a$ \% u, l& t1 U% t( [& s and instructions for this requirement. You will need to use your University of
2 b: `! ]! p. I/ B4 Y Tasmania (UTas) student number.
, f" G, p' p/ c+ u+ A, l . c5 k) {1 @. ^1 Z( D" ?2 Z
% W# Q! ?+ T& k5 c1 l Page 2 of 5 9 s0 A$ j( R% T4 o
; C4 |+ c9 n+ r' {$ g
For requirement 5 use the following data:7 L# q0 Y0 _. L. E" C4 R
2 F& B3 b& g& ~! ~, \9 r" T- m- k# k
# Data Set 1:' x( A7 B8 x. U" \& @
/ Z8 `0 D- n A( `+ `4 {! m, [( oUser name: JordanM" m4 D2 Q2 [! I0 ]
Password: Ferrari
9 Q0 |! n' u" V4 w" D/ E" J) OBorrowed: $ 749.95
3 }9 u& _: P4 ^/ `' Q: kInterest: 15.0 %
, O6 {# |4 t# ~% H2 t2 cYears: 47 T# F! I" R; L
) \& M1 v7 Y5 F$ a# Data Set 2:
, }5 w: P6 o& S! z8 ]. ^/ h5 W: U
: y7 Y- Y6 @+ ]) g# n! _* MUser name: KimZ
/ b0 f1 _- P, K# E/ `" @Password: DimSim4 z8 `8 L# v) Y* q
Borrowed: $ 150500.25
( N2 H" W" l4 o( y1 r& f' {- C2 F. xInterest: 5.5 %7 j4 a( S( m/ [3 I( h- |
Years: 72 n) l1 \. h' K" Z* T
4 A* e8 o9 ^0 Z* g
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|