java编一个程序eclipse_求大神用eclipse java 编写一个程序,全分送上,急求,谢谢了...

问题描述:

求大神用eclipse java 编写一个程序,全分送上,急求,谢谢了

The program should prompt for and accept three values from the user:

· the initial deposit amount (a double value representing the deposit value in dollars)

· the rate of interest earned per annum (yearly) on the account balance (a double value representing the actual interest rate percentage, for example, 6.0% would be entered as 6.0)

· the amount that is to be deposited to the account each month (assume the deposit amount for each month is the same).

Once the user has supplied the initial deposit amount and interest rate for the account as well as the monthly deposit amount, the program should then proceed to calculate the new balance for the account (including interest earned) over a six month period (taking into account the additional amount being deposited and the interest earned for each month).

This should be done without using loops of any kind, as the emphasis is on using variables to help break down a repetitive process into here.

A simple way of handling the calculation of the balance for each month of the investment period is shown below:

balance = balance + monthly deposit amount

interest = balance (current) * ((interest rate / 12) / 100)

balance (new) = balance (current) + interest

Note that the interest rate is per annum (across the entire year), so the interest rate percentage for each month is equivalent to the yearly interest rate divided by 12.

1个回答

分类:

综合

2015-05-21

问题解答:

我来补答

不许用循环...好吧

public class F_uck_u_boss{

public static void main(String[] args){

...

}

public static double after6month(double deposit, double interest, double permonth){

double balance = deposit+permonth;

interest /= 1200;

balance = after1month(balance, interest);

balance = after1month(balance, interest);

balance = after1month(balance, interest);

balance = after1month(balance, interest);

balance = after1month(balance, interest);

balance = after1month(balance, interest);

return balance;

}

public static double after1month(double deposit, double interest){

return deposit*(1+interest);

}

}

展开全文阅读

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值