|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊2 A4 O5 n o1 o) N q
有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
& I" r1 {! Y- z! c: p; ]9 FRequirements:
9 E4 L" |2 u& r3 f" a; x" W. FConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
, S! |3 k! N& r# T- GAssignment 2 page on Vista. 7 y$ `" o+ U) N7 t
. ]5 e) X: R7 `: w C; rYou are required to perform the following tasks:
; T) v7 e1 o1 w/ W0 p( i, V- y- i. v 2 s E4 _- n+ F) f5 Y6 [. G- ~! C/ u
The RepayCalcMenu class: (Total maximum 20 marks available)
8 L( v4 B4 _7 P% L: G4 a
3 `: n8 \, N: |" X: Z9 e 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon
( [' t5 t6 F U9 f! b4 R Finance Company so that it can be used by the Megalodon staff members to 5 t) _* a+ k5 A6 ?6 ^6 Q, p
determine repayment options for their clients. 3 g4 R6 A, y9 {& Y( r1 ^) H I& l1 M4 _1 e
2 G; @! p* o4 J" o+ C
The staff must be able to: " r2 b' Y( b" n
, R F; e' I! G
* Log on to the ‘system’ using their user name and a Personal Identification
- B2 S% N# i4 z& J Number (PIN), which a four digit number **.
: Z& i* K9 e6 q. S3 E# A7 S/ Y6 L; }4 R0 h
* The user should not be able to use the ‘system’ until they have provided the & k( \: L. h$ w+ |
correct user name and PIN combination. You should give them a second or + V- y8 n6 j) u1 F l
third chance to get it right before shutting the ‘system’ down. . i5 W, T6 J5 n T9 [
# }- q1 q! U; y; _4 }, z" d : s6 o6 u/ `6 T! M
7 p* }1 S3 y3 n5 T% T
** You must use the user names and passwords provided in your individual 6 u" l: t2 V; f
% H% o5 j/ {$ T
data available from the Assignment 2 page on Vista (see requirement 5 below). 6 W3 P" V8 i( w4 V, X( t
The user names and passwords should be included in your code, and the output $ D3 q" [2 s( ]' E0 C/ a. u
to the screen should prompt the user with the user names and passwords (for
2 c2 _, P+ G% \; t$ a: Q# a
& v- X% r; p1 k" ?5 }2 Q2 m9 F+ v marking purposes). . w$ S' @9 c: i" i9 W& w; V( L
8 d `: W% |6 @/ X& s5 t$ f! s, O
) R/ T) R# E5 }- Z
2 v) T, S4 G$ z! M) A1 O* The interface should provide a menu so that the staff can: : s4 m8 K+ ]3 q$ N. w3 K
; e% A1 ^" G/ u. m- o& h- n1 G3 H - Perform a Repayment calculation , ~5 {* O: r) \% v) u
6 I% |* ^% g0 C
- Print out to the screen the Repayment details % ^$ G1 R) H6 N$ ?3 g& G
% O( Y0 Z5 [+ ]: ?/ e6 r
- Change one, two, or all of the values for the current calculation
& d7 l' X" ~6 d
+ Q( R" @7 z4 q' M5 ? - Start a new calculation
/ |" M' U5 ~# h0 c7 k; e0 r
. K! C s# B' [ - Leave the program.
5 |, I8 f4 G& J/ OThe RepayCalc class: (Total maximum 10 marks available)
0 K" t6 q/ [. b
% x+ E( B* N* T9 M 2. Provide a method to accept three input values from the user: 6 e, s- d2 S' m4 D, G, w2 @+ @7 O3 t
% x3 t- P8 ?2 l' y7 p' D
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00)
( x( y0 y$ J' Q, v% p4 H | j
: m/ Z% a/ z9 `$ T1 Q7 [4 h7 ^ - the Annual Interest Rate (to 2 decimal places, for example, 9.75)
; K, e. u- [' m3 n9 F& c, g# [# `5 @) E8 J
- the Period of Repayment (in whole Years, that is, no fractions of a year) / h' G; q& }1 A9 h/ A) M! j1 O
: h1 l* M8 T1 k* c% r/ T6 q 3. Provide a method to print out to the screen the three input values (accepted in
: E4 e, B, N0 \) O4 R requirement 2), plus the repayment calculations:
& S% G1 e: a! _& K, [ L; V( s! k9 {# f
- the Weekly repayments + I! _3 v3 d0 n7 J- O# M, b6 ]
$ h# s# Q$ c+ J% J- A. C - the Total repayment amount (Amount borrowed + Interest) & {4 h7 X; T# ^( y
. k h- Z% A: A5 f8 e" t# ^
( i" ^. E; C1 N5 ?; i8 R
$ {+ Y" @) C+ ?# B( b2 GThe Borrow class: (Total maximum 40 marks available) 2 g* f' N V3 q1 f% b* E% a
) U: ]+ q# z2 U9 s5 N$ u
4. Provide methods to perform the following tasks:
* h3 W( u+ x5 e# I% G* N O0 g* R/ @/ O$ e) l( ~
- to calculate the weekly repayments *** ' L P/ B& D9 ^* s- G/ y; v6 F; H/ `
8 r- U0 D8 u/ N$ u& f! b9 W v - to calculate the total repayment amount
* j2 k0 U; H) L" j$ r7 U+ |* A: w, F" s! C1 _/ W1 E$ r4 \( ?
- to return the amount borrowed
" j/ w' }! }3 J7 ]: l* u$ k4 ^' E3 x8 Z
- to return the borrowing period in years
9 X0 v# C3 k3 b4 G1 f0 a' j
8 V2 j+ G( r2 T% Z/ s* } - to return the borrowing period in weeks
' ~0 B7 d- F( P+ b- [
2 j" e+ A: {" Q& H D J - to return the annual interest rate ! k# m1 w A; \8 q$ K
9 X) _; S% U# [+ Q5 }" l8 O/ S7 U
- to return the weekly repayments
$ T" v% I. b# w- s) D
$ j: T* {/ x5 u7 D6 n5 L! u - to return the total repayment amount 4 g5 F+ G) d6 o- f
% b1 h8 u6 Y$ Y/ A! |- ~/ S' M
- to reset the loan amount
' |2 P( |4 A* I( \! f' k" I2 X: Q6 H6 E
- to reset the annual interest rate
4 q5 k' x7 V8 w
6 F9 _- K5 D) ]/ o- P& h4 t - to reset the loan period (in years)
8 e) ^; z- J9 B% Y2 ?' S1 V- q# [- ?7 O9 e2 D$ H( b8 N6 S1 A8 L
0 f6 u' R5 P; ~# c- C7 R8 I& ^& T2 ?
; @' { f7 A9 ~ {2 o e) X( Y" E
*** Use a simple interest calculation (not compound) formula, for example:
6 e+ f3 Q% j2 l) U3 l2 u5 L ; }" w' B! h! Q' I
weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate * ( i% [ v6 x1 k. |
numberOfYears )) / numberOfPayments;
$ N& J) \% @ {$ V" h8 W2 H0 X2 ]
; }5 @6 N" v; }( ? 9 @6 c4 C* _+ s, j' N D5 e
# s+ s; N# S. n0 }! ~) i
+ v# G) d8 z/ P" @5 ]# v7 V% A4 J: Q* a) ^, ~& o7 v# ?7 e E+ Z
Individual Data (Maximum 10 marks available) / c! P6 C# G' ~! v# k
/ T; z2 V% Z9 z L* j
5. You will be given two Megalodon staff member user names and passwords, plus a set - I5 b' S- T* ^2 e" i. j! F0 j
of data for each staff member to use to calculate repayment details. You will need to
7 ~: N* k# W# f$ c7 }! I log onto the BSA104 Assignment 2 page on Vista to generate your individual data
4 E p/ B9 N5 P8 v and instructions for this requirement. You will need to use your University of
/ Y1 @4 Z! J) |7 Y! W1 C D4 \ Tasmania (UTas) student number.
: k# b' R; o& W3 X# Y( l6 j; Q' Q
" ] J4 }6 \8 D" X; d5 j0 D6 P B4 X
Page 2 of 5 7 j. |0 J% d3 d$ q/ P- o4 E
. k# Z8 R$ \! }7 h' w5 c) G, T" w
For requirement 5 use the following data:
7 F& O Q3 @- H* p9 z# f, x" g0 J! K
# Data Set 1:, T, q P, M X: p4 Z
$ j# y3 P. X/ `1 u5 ]: g4 {9 t4 b! t
User name: JordanM
P! P5 X1 ]3 ^7 XPassword: Ferrari
. ?" \) k+ f, V6 t! H D( ]0 VBorrowed: $ 749.95
5 v) P$ @/ d# i/ TInterest: 15.0 %
( Y* B* v8 U( d7 Q! ]3 s! D IYears: 4
& Y' }) e3 x% W1 U, v. }7 i
{2 X% F! w. ^! M6 c \0 T# Data Set 2:
, Z6 B, y- _* l5 }1 d- _5 [7 S/ z4 b O4 [1 z8 f: m
User name: KimZ
4 Y/ q' s) A K$ V8 }, o$ oPassword: DimSim2 F& G$ K( n' m4 Y8 [
Borrowed: $ 150500.25+ X* Q8 S$ @6 D5 Y, i! U- [
Interest: 5.5 %% U( w! q0 C3 M9 A; L
Years: 7; Q% u' `; R/ j z
' [+ t5 y1 f2 S( o- z# o/ p
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|