代码拉取完成,页面将自动刷新
同步操作将从 贾沈杰/teamdemo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import java.util.Scanner;
/**
A program that reads in an interest rate and creates a table of
future values of a one-thousand dollar certificate of deposit
for that interest rate and different numbers of years.
All variables should be of type double, except for the number of years.
*/
public class CDTable
{
public static void main (String[] args)
{
// Display prompt for interest rate
System.out.print("Please enter the rate of interest: ");
// Read interest rate
Scanner in = new Scanner(System.in);
double rate = in.nextDouble();
int years = 0;
double presentVal = 1000.00;
System.out.printf("%2d %7.2f\n", years, presentVal);
double finalVal = 0.0;
for (years = 5; years <= 25; years += 5) {
finalVal = presentVal * Math.pow( (1 + rate / 100.00), (double)years );
System.out.printf("%2d %7.2f\n", years, finalVal);
}
// Print out different values for different years
// Your work here
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。