import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         System.out.print("Enter the balance: ");
         double balance = input.nextDouble();
         System.out.print("Enter the annual interest rate: ");
         double rate = input.nextDouble();
         System.out.print("Enter the number of month: ");
         int numberOfMonths = input.nextInt();

         input.close();

         System.out.printf("%10s\t%10s\n", "Month", "CD Value");

         for(int i = 0; i < numberOfMonths; i++)
         {
             balance = balance * (1 + rate / 12);
             System.out.printf("%10d\t%10f\n", i + 1, balance);
         }
     }
 }

HW4.31的更多相关文章

  1. 城市代码表mysql

    只有代码: # ************************************************************ # Sequel Pro SQL dump # Version ...

  2. CSharpGL(31)[译]OpenGL渲染管道那些事

    CSharpGL(31)[译]OpenGL渲染管道那些事 +BIT祝威+悄悄在此留下版了个权的信息说: 开始 自认为对OpenGL的掌握到了一个小瓶颈,现在回头细细地捋一遍OpenGL渲染管道应当是一 ...

  3. 计算机程序的思维逻辑 (31) - 剖析Arrays

    数组是存储多个同类型元素的基本数据结构,数组中的元素在内存连续存放,可以通过数组下标直接定位任意元素,相比我们在后续章节介绍的其他容器,效率非常高. 数组操作是计算机程序中的常见基本操作,Java中有 ...

  4. SQL Server查询第31到40条数据

    大致分为两种情况:ID连续和ID不连续. 1.ID连续的情况: 2.ID不连续的情况: (1).两次对表查询,效率较低. ID from A) (2).外层查询没有对表A进行查询,效率提高. ID f ...

  5. 把《c++ primer》读薄(3-1 标准库string类型初探)

    督促读书,总结精华,提炼笔记,抛砖引玉,有不合适的地方,欢迎留言指正. 问题1:养成一个好习惯,在头文件中只定义确实需要的东西 using namespace std; //建议需要什么再using声 ...

  6. 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButton, AppBarButton, AppBarToggleButton

    [源码下载] 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButt ...

  7. Lind.DDD.Manager里的3,7,15,31,63,127,255,511,1023,2047

    回到目录 进制 我是一个程序猿,我喜欢简单的数字,十进制如何,数字太多,有10种数字组成,但由于它广为人知,所有使用最为广泛,人们的惯性思维培养了十进制,并说它是最容易被计算的数字,事实上,在计算机里 ...

  8. 2017年1月5日 星期四 --出埃及记 Exodus 21:31

    2017年1月5日 星期四 --出埃及记 Exodus 21:31 This law also applies if the bull gores a son or daughter.牛无论触了人的儿 ...

  9. 2016年12月31日 星期六 --出埃及记 Exodus 21:26

    2016年12月31日 星期六 --出埃及记 Exodus 21:26 "If a man hits a manservant or maidservant in the eye and d ...

随机推荐

  1. scala - 从合并两个Map说开去 - foldLeft 和 foldRight 还有模式匹配

    开发中遇到需求:合并两个Map集合对象(将两个对应KEY的值累加) 先说解决方案: ( map1 )) ) } 这特么什么鬼  (╯‵□′)╯""┻━┻☆))>○<)  ...

  2. ECMA5.1中Object.seal()和Object.freeze()的区别

    1  Object.seal(O)的调用 When the seal function is called, the following steps are taken:   If Type(O) i ...

  3. notepad++插件使用说明

    在进行渗透测试的过程中,经常需要分析一些js或xml文件,或者是一些url,它们多是经过压缩或编码的,看起来不方便.这里介绍几款常用的notepad++插件,会极大的方便我们的开发测试. 1 Xml ...

  4. 【原创】解决国内Android SDK无法更新问题更新

    使用代理,推荐使用shadowsock 在SDK Manage的tools-options填好代理 服务器地址127.0.0.1 端口1080

  5. 两个for循环例子

    var i,j; var a=0; // for(i=0,j=0;i<5,j<7;i++,j++){ // a=i+j; // } // alert(a) //12 for(i=0,j=0 ...

  6. php 简单的验证码

    注意事项: 验证的隐藏域的位置一定要在调用JS前.. 如: <input type="text" name="yzm" value="" ...

  7. PHPUnit初试

    先测试了一下加减,检查一下环境,又调用函数测试了服务器名. 源代码: class DemoController extends \Think\Controller { /** * @assert (5 ...

  8. 发测试邮件或垃圾邮件node脚本

    npm install nodemailer 执行后,指定目录下会出现node_modules模块,再相同目录下,创建main.js,js代码如下: var nodemailer = require( ...

  9. jquery 的新使用用法

    在1.9.1jquery版本中,live 被替换了,现在使用on事件 在动态添加的行中使用下面可响应 $("tbody").on("click","b ...

  10. ubuntu下的软件安装

    1.软件安装 最近开始将个人电脑由windows换成linux,第一步就是会装一些个人软件,以前玩linux都是用yum或者apt-get来进行安装. 下面介绍一下如何从官网下载文件并且安装的方法. ...