|
|
|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊0 ?/ H2 C" M* s. t" [. c; j
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
( m6 C2 n: z$ ~, e# NRequirements:
4 f: ]1 g0 A/ fConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
* i, s3 b" ~ m7 b6 b! K# hAssignment 2 page on Vista. 6 I; ?+ }1 X7 B" I% t5 y
- ^8 [' G; \/ s7 `/ _( e1 b4 `
You are required to perform the following tasks: 7 ?+ ?/ S. j! l/ L3 |, @ W8 \
0 N: E- I. n r* A1 E& C& wThe RepayCalcMenu class: (Total maximum 20 marks available)
- L6 q; X B* c! E, I' o
4 r* v& P0 t; b) T* x1 E 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
, R8 y- x: U3 p! c J5 O Finance Company so that it can be used by the Megalodon staff members to . O. u; F0 X! I" A2 A# m4 J: g
determine repayment options for their clients. ' Q9 g- o8 B) v6 S
7 R$ f% w6 e% ^+ K x The staff must be able to: * v2 Y6 `; U; O
1 p' D+ \8 e4 K& g [4 h * Log on to the ‘system’ using their user name and a Personal Identification 4 t2 S: A5 E- }, \5 ], O
Number (PIN), which a four digit number **. ! D. A/ n# `3 t) v/ _* c
$ s9 m) O: n0 z * The user should not be able to use the ‘system’ until they have provided the `* d8 O( H8 u$ T# a
correct user name and PIN combination. You should give them a second or
: I) e1 A' Q2 c third chance to get it right before shutting the ‘system’ down.
! u+ k% ~9 Y0 x- P2 l7 o' b! U
9 H7 B) a6 [2 Q3 b6 J6 G& h- }: [
& W- e( g. l% y6 @' E: d ** You must use the user names and passwords provided in your individual
* q. |- w+ S+ Q: y6 E9 q& G, Q8 W# y% E4 c
data available from the Assignment 2 page on Vista (see requirement 5 below).
; v7 ?" S( m8 c6 n# U The user names and passwords should be included in your code, and the output 5 h4 _4 h5 w+ n
to the screen should prompt the user with the user names and passwords (for 7 t1 q) f4 c& c3 ?- w2 R
8 |3 p+ H& _7 Q" \. z marking purposes). ( d- W6 L: Z# S# t
1 Z8 i4 w# I# f. f
+ ] A, w. ]3 R. C* H
. c) N' z6 I2 y9 K/ j* The interface should provide a menu so that the staff can: 5 Z# C: A2 |0 c9 g- Y: L2 E3 E
6 ] t% F+ q; I p5 c- |
- Perform a Repayment calculation
$ b1 |- L4 ^8 D# w
f8 ~ O6 \$ j - Print out to the screen the Repayment details
5 `( t/ b4 a) \
+ ?) D$ a8 H3 }- E$ ^" m - Change one, two, or all of the values for the current calculation
& e! r% w! @ p, V" U U. e0 A# g5 s1 {- D; a
- Start a new calculation
1 `% [, t5 a) H* j, G" E" A+ |% Q3 }# p5 b2 h. p1 c
- Leave the program. : b4 d# ?7 q4 z. F- n7 R
The RepayCalc class: (Total maximum 10 marks available) 0 E1 h# b0 n2 T/ e+ U( P( r( u
, e3 l S+ s/ \8 K9 z 2. Provide a method to accept three input values from the user:
% t& F R) X2 T! i4 m F! E( N! K6 |5 T) H0 s
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) 3 B5 m' @; R: j) [
2 F1 l ?! O6 J1 j. i" q: r - the Annual Interest Rate (to 2 decimal places, for example, 9.75)
" O) q4 j$ f/ e/ } ^+ l' ~# N' F# f ]' E0 r. U$ ~4 ~3 g: ~
- the Period of Repayment (in whole Years, that is, no fractions of a year) Y6 Q& M, t- x- u- }+ ^
+ {. q: d @3 a 3. Provide a method to print out to the screen the three input values (accepted in
% i1 ]; v$ p* V4 [ requirement 2), plus the repayment calculations:
9 \, H+ {- V0 v# j# _# `& Q6 Q! a9 h
$ T/ ^+ }, l% N$ [. b - the Weekly repayments & x6 y I8 E, c# X4 z
7 o# T, L% S/ F- v - the Total repayment amount (Amount borrowed + Interest) & r0 m' v% V7 z5 p
1 y* S3 Q) T1 J% U6 M
, n* R- E1 O7 B5 K; S& [
0 j$ j" D* `4 d" o
The Borrow class: (Total maximum 40 marks available) * a; t4 L2 _/ q: W: i
9 `' U4 H0 {, W 4. Provide methods to perform the following tasks:
1 _5 @# A4 z9 W: @7 @9 q. U0 }6 G: U, x0 ^; `; ^2 m0 |& H; ~
- to calculate the weekly repayments *** ) E/ u9 `% B+ d4 @
M5 o( N" Z/ f* N( u. n - to calculate the total repayment amount
# \# l) ~- K$ E6 |! o" e& b* ^5 t' o l
- to return the amount borrowed
' {4 }8 [% ?1 k, _' j z. Q$ A6 x, a9 b f. b
- to return the borrowing period in years " ^3 H: T p! _8 j% [! e: W% I7 ?% e; t
) p3 ?5 }2 M5 D( I, o - to return the borrowing period in weeks
( Q, `5 W* W* K: a% Q0 G! }. u. q8 }. ?6 y# T
- to return the annual interest rate
3 g% k' D* M0 V" X U$ C7 X* j
: a" e) k9 ], n* t. @ - to return the weekly repayments % G2 T) @: X3 f
; S3 t7 {7 c* m- t
- to return the total repayment amount
9 b7 P: y3 C" z9 e* s, i) v% p4 S0 U1 | \
- to reset the loan amount
7 b1 _& X/ T2 z6 J- S% J
, L0 m# Q( h" u! J0 `5 V" e - to reset the annual interest rate
+ L% N3 S e, y# O0 G0 W' H
+ R% M* @% k( U; e - to reset the loan period (in years)
# b8 ]$ b- P* q% D( |# G2 i
D) A# U, E% I! ?$ e : B! d: `0 Z2 n% H
" [& Y& \' k ~2 B' `1 k
' }! i8 w8 J) |1 e4 V
- c! Q/ u& P8 T; V# U) Q- a
*** Use a simple interest calculation (not compound) formula, for example:
/ B# \9 @, P7 \# A* T 1 i9 T' p8 `+ Z" g# A
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
% n h9 C5 @$ X" G0 |' w2 n$ H0 j numberOfYears )) / numberOfPayments;
6 N4 E5 Z& Q1 ]; r
: f% m3 N; y. C8 b3 d 2 `3 W9 C& v& i8 O) y" O+ P
/ r# c$ ?* ~7 g0 F
( I9 F% Z+ |' s# G( \3 P9 h$ G# f1 r1 Z9 w; k$ a
Individual Data (Maximum 10 marks available)
" H: g8 w( C3 X$ l9 c* O
* ~$ ^8 V/ K5 G! v* W 5. You will be given two Megalodon staff member user names and passwords, plus a set 5 E' x, e P. i0 Z
of data for each staff member to use to calculate repayment details. You will need to 5 @5 ^0 q* l2 u2 {
log onto the BSA104 Assignment 2 page on Vista to generate your individual data * c, @& ?9 @" R& ?" T# @$ k7 `
and instructions for this requirement. You will need to use your University of
+ P3 v1 W! D5 \7 `. |+ q9 R Tasmania (UTas) student number.
7 h4 v: [, G+ }, ]& z$ }
/ n+ l/ Z; b+ p3 ~4 q/ t) V8 l
/ M( X9 ^+ `& ?) s3 S' Q( x' m Page 2 of 5
: a5 ~, D" N/ u6 p4 S2 b7 a
+ _# A7 ?" I' {5 UFor requirement 5 use the following data:& t" q6 U, e7 `
% K& Q: p# L! o* g- d
# Data Set 1:7 X+ m" h( K& r& n! a5 `, S
, p0 ]' V% \5 I+ l! D
User name: JordanM; @* ?0 I* G7 a6 x. [) d$ Z
Password: Ferrari! D4 W& v. e9 |6 T q: i
Borrowed: $ 749.95
7 R' H2 E( z# T) JInterest: 15.0 %
! C& ^* n. l% \- @2 CYears: 4
8 C- ]/ c' s2 S1 R$ o/ p& H
9 L+ u4 x) ^ E( G# Data Set 2:
/ {8 `7 y! _8 v6 e, ]: n0 d) p1 O e5 E1 S' {1 j6 w
User name: KimZ" _. L. {1 a- D4 Z7 ?% D- H. L
Password: DimSim
" X/ ?; W) _ L; T0 c6 ~9 t" ]0 zBorrowed: $ 150500.25
/ ~: E( P1 i8 K9 l, l# Q% o. PInterest: 5.5 %' A/ `; p! e% y' K2 _/ J- k
Years: 7" F7 U- T9 N) k3 Y0 `6 ]: Y
& g/ ~- |' F A R# d. U[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|