|
汗,真是不知道怎么写,同学找了个哥哥,3个小时就搞定了,我编了3天,还有100多个错,可怕啊
, d6 k& n9 o/ U2 L6 j$ X7 \有没有高手帮我哦,周5就要交了,我的邮箱是[email protected],谢谢啦
! S& g1 t b2 E' a1 `% F, ?Requirements:
$ y5 z; J- `" \, r$ T' PConsider the three Java Classes: Borrow, RepayCalc and RepayCalcMenu, available from the
% \- O+ h- V5 s9 MAssignment 2 page on Vista.
0 m1 [4 ]+ q" j$ A7 H9 F; B: a2 ~! W . Y* x1 }( f) Z2 @% I
You are required to perform the following tasks: 9 L/ I2 t7 X5 C" n( {3 g
& W% O; [5 d- g6 V
The RepayCalcMenu class: (Total maximum 20 marks available)
9 \! p; i% I; _% d# e
9 C! b' X- \& U. ^6 e' i* e 1. Provide a basic text-based interface to a Repayment Calculator for the Megalodon # a) Y @/ n2 T, H# L6 R! {
Finance Company so that it can be used by the Megalodon staff members to
& c. Y) a# g) |3 ` determine repayment options for their clients. + j2 O5 ~3 W! f
- v3 O* z) y3 t! ]% j8 D
The staff must be able to:
, y. W/ P) d& E: p# [. V) _
2 L- ~ d* t! i * Log on to the ‘system’ using their user name and a Personal Identification ( P( |1 e1 {8 I0 p; B6 a( p
Number (PIN), which a four digit number **. 3 n4 y k6 a! u( z' N7 A
8 `& f( f' P( H9 j6 E) u& R
* The user should not be able to use the ‘system’ until they have provided the 9 A# L0 s8 ]+ C" x
correct user name and PIN combination. You should give them a second or + _. m9 `, h) b& p& Y
third chance to get it right before shutting the ‘system’ down.
( O6 h) M: E# Y! o* h
( f. ?8 u/ H5 J0 |( R2 d' d
$ b/ h9 ^; K7 [+ A' z3 S: H: h0 ?
2 b1 I$ ~' O' I) D7 H ** You must use the user names and passwords provided in your individual + a' u6 ~, R9 C0 K8 z7 G9 u# [
2 C9 F$ B7 H& n# k( Y4 V0 I" n" u data available from the Assignment 2 page on Vista (see requirement 5 below).
1 f4 y3 s# D0 r9 I% v The user names and passwords should be included in your code, and the output - g# Y2 d3 }; ?2 a( F( K! ~: @% h" C
to the screen should prompt the user with the user names and passwords (for 0 K- {* \! j2 M. F* |
: r) P, [$ u/ [6 W1 _ marking purposes).
- H6 M" r1 C" a Z: ~2 s6 n# ^2 ^# ^' \( [0 T$ O0 G
+ z, m1 A7 b4 Y' q
9 _* a$ y2 n! c# t* The interface should provide a menu so that the staff can:
0 @7 c' c2 k% X8 ?) O" I
, \5 l" S1 R! y; R: k( B9 `# A - Perform a Repayment calculation * }3 d! a5 e2 Y
* E; e! p: r4 R( m
- Print out to the screen the Repayment details
7 l* X, L% Z- _2 o
# U- K% p! _/ R6 _9 p+ i, J$ q7 f - Change one, two, or all of the values for the current calculation ( U* ^2 Z1 i9 t1 } p5 o
5 E; q( [( r1 H( [
- Start a new calculation
/ d3 s' E! `/ r0 v3 S5 z
6 p. Y) o& m$ [1 r' {7 ^7 _ - Leave the program. 3 e# E) A5 R, E5 k, c& ?
The RepayCalc class: (Total maximum 10 marks available)
1 t/ C1 B% t+ ^4 I: X5 k, \9 L
/ r0 X7 X3 e9 t- k1 q 2. Provide a method to accept three input values from the user: 6 C4 k2 x! \" p2 k
a$ M8 \, t" b; g3 T" c
- the Amount to be Borrowed (to 2 decimal places, for example, 10550.00) - Y! w/ E. T5 P# p, b c: J
3 Z- L; @3 u2 P8 ?" t0 L9 Y
- the Annual Interest Rate (to 2 decimal places, for example, 9.75) * N4 d+ P. d9 k
. Z8 a1 D3 q/ k2 P- V/ ~ - the Period of Repayment (in whole Years, that is, no fractions of a year) ; x- G; H1 Y; Y; ]; W) ]0 P+ D
4 H/ x( G3 _% C* |
3. Provide a method to print out to the screen the three input values (accepted in
R# _) V; B) Y% Z requirement 2), plus the repayment calculations:
h9 W) v! ^- H. H. ?- O) u" ~. b1 t8 ^; U. L& ]) F
- the Weekly repayments
# H+ E2 |- x8 ]# [, L
; X7 A* j. D. D$ z - the Total repayment amount (Amount borrowed + Interest) & P- D* _' u; l+ w2 G/ A0 @
/ A3 Z' O/ `, G2 S ; Q+ g8 R1 a, l: O
* h" \; A7 w2 C5 ~The Borrow class: (Total maximum 40 marks available) ) A: f6 G" {+ `$ |* P0 Q
( v( @$ a5 D- [, C: k
4. Provide methods to perform the following tasks:
! e9 O6 Y4 q$ D c
0 m* t) O s# q - to calculate the weekly repayments ***
* C; A. D/ c! S: i; A" @/ \4 G; F |4 a: V( Q2 d
- to calculate the total repayment amount
% U: ?% |) S0 U- X; |
|+ [8 O' b$ U3 Y5 E1 a - to return the amount borrowed
1 ]! `4 V2 W' u: d9 p3 h" S, [% _6 c6 v9 A+ s$ }4 T
- to return the borrowing period in years
- W8 R# [! O$ j2 `" i/ e# N" h, T8 Y- G- p# N
- to return the borrowing period in weeks . @* S7 f2 s P! W Q( b
* L& Y/ v1 {# w5 _: Z e* k - to return the annual interest rate 7 R# E4 o" e' n/ z; ~! Y6 J
9 C' W( P9 A7 K$ p. b/ w( E - to return the weekly repayments & K m1 H: ^2 o' i1 m* X* V
2 T, ~1 I7 \! s) a4 U
- to return the total repayment amount + R) x* z1 F- e* f# w; T+ h; c; t
" s9 n& S; S7 d) x7 a' z
- to reset the loan amount
4 Q3 J- D$ F6 ?' C7 ~5 A& h* Q% l4 u6 I* J$ L3 d* k
- to reset the annual interest rate
: ~, j% K3 |, M5 |1 S7 N3 `) N! K% @
- to reset the loan period (in years)
( A- W- W. I. P z2 B$ k5 e" Z* Z* a+ m/ Q1 a# ?
2 w9 ?" ?2 R% x. _3 k# R) T
" z0 z/ s; Y9 n! y. F; u
4 G7 d* T9 `% e0 }! j% C" R5 C9 r
( I6 W) \0 A( D: J3 o *** Use a simple interest calculation (not compound) formula, for example:
6 L+ n8 w" F2 {( V" l# l! T
( g( P6 S$ e- g. Z) T weeklyRepayment = (borrowedAmount * 1 + (annualInterestRate *
. V& L- _9 c! s2 q( ` numberOfYears )) / numberOfPayments;
8 V, m d5 R$ U0 ]7 X' G9 k L
0 ~# g0 y$ P$ A9 G$ k! M
; A7 |& K' p- [, O% C* y4 B( M2 u) t
- o$ B- { u; ^# z
5 E, Q, B; j4 ]
Individual Data (Maximum 10 marks available) 2 ?1 G6 l9 p/ b3 g' V
* H" C/ ?$ L ?" I
5. You will be given two Megalodon staff member user names and passwords, plus a set
0 y# D) o0 }4 V! {( ^1 E3 R3 m8 G of data for each staff member to use to calculate repayment details. You will need to
! O+ z5 E! \) E. q9 H0 n4 G- ^3 x log onto the BSA104 Assignment 2 page on Vista to generate your individual data + L( H- \- G" s
and instructions for this requirement. You will need to use your University of
l* N- m4 o$ _+ _* T5 U Tasmania (UTas) student number. 2 k0 j6 I8 W% r. X
" r/ X+ {5 b( W* G
& \0 a$ v6 t9 ? Page 2 of 5 . K9 q3 V# h2 z
4 c1 \9 M- B! ~ lFor requirement 5 use the following data:
. T& [7 t0 W$ W( |+ d5 \) t; i5 i; ^- a# Y6 m3 p
# Data Set 1:; R7 a B; Y5 }* H7 Z% k
: b: q" H( T6 a( @' K
User name: JordanM
' _, a+ P7 k# E1 tPassword: Ferrari: m( {7 }# N4 y! ^" k
Borrowed: $ 749.95
" X- X, C- p: e* n+ PInterest: 15.0 %: y+ W1 ?2 }8 _* M9 U
Years: 4
# C Z# h N9 _! f: Z* U- p5 c+ h
$ |( J( Y/ u( z/ T& s, T9 p# P# Data Set 2:. t3 [; ^: F! i5 |; a$ }( `
! V; q' E- { l ^1 G$ V& A
User name: KimZ
! t5 l# ^0 z/ J. b5 s. ` W0 lPassword: DimSim) v7 ~: v9 |8 K% q8 Z5 [
Borrowed: $ 150500.25
$ L1 k6 @$ G, c8 O0 H6 p6 yInterest: 5.5 %& A! H' L: P J6 P2 U+ `
Years: 7/ L+ n8 n% q# }
, f: s, V( S& @) O4 o# U" U0 z
[ 本帖最后由 wwwsnailcom 于 2006-5-24 02:15 AM 编辑 ] |
|