1.客户说:帮我开发一个复利计算软件。

完成复利公式计算程序,并成功PUSH到github上。

截止时间:3.10晚12点之前。

按照这个要求完成了。

演示。

计算:本金为100万,利率或者投资回报率为3%,投资年限为30年,那么,30年后所获得的利息收入:按复利计算公式来计算就是:1,000,000×(1+3%)^30

客户提出:

  2.如果按照单利计算,本息又是多少呢?

3.假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢?

完成23功能,并成功PUSH到github上。

截止时间:3.12晚11点之前

记得更新进度条。

另外,是否预感到客户会有进一步的要求,而在下次会面演示之前有所准备呢?

 

  以下是 index.jsp 主要客户端 代码 :

<%--
Created by IntelliJ IDEA.
User: pc
Date: 2016/3/11
Time: 20:46
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Compound Interest</title>
<style type="text/css">
body{
color : rgba(33, 157, 196, 0.8);
font-size : 50px;
margin: 20px auto;;
} </style>
<script type="text/javascript">
function check(form){
if (document.forms.compoundInterest.principal.value == ""){
alert("请输入本金 !");
document.forms.compoundInterest.principal.focus();
return false;
}
if (document.forms.compoundInterest.interestRate.value == ""){
alert("请输入利率 !");
document.forms.compoundInterest.interestRate.focus();
return false;
}
if (document.forms.compoundInterest.year.value == ""){
alert("请输入年份 !");
document.forms.compoundInterest.year.focus();
return false;
}
}
</script>
</head>
<body>
<form action="<%=request.getContextPath()%>/InterestRateServlet" method="post" name="compoundInterest">
<table bgcolor="1" cellpadding="0" cellspacing="5" border="silver" align="center">
<tr>
<td align="center">本金 : </td>
<td><input type="text" name="principal"/></td>
</tr>
<tr>
<td align="center">利率 : </td>
<td><input type="text" name="interestRate"/></td>
</tr>
<tr>
<td align="center">年份 : </td>
<td><input type="text" name="year"/></td>
</tr>
<tr>
<td>利息类型 :</td>
<td>
<input type="radio" name="interest" value="compound"/>复利
<input type="radio" name="interest" value="single"/>单利
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="提交" onclick="return check(this);"/>
<input type="reset" name="重置"/>
</td>
</tr>
</table>
</form>
</body>
</html>

  以下是 InterestRateSe 主要 服务端 代码 :

package Servlet;

import Model.Interest;

import Service.OrInterestService;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; /**
* Created by pc on 2016/3/11.
*/
public class InterestRateServlet extends HttpServlet {
/*
* 创建 interest
* :本金 利率 年份
* */
private Interest interest = new Interest(); /*
* post 方法
* */
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
interest.setPrincipal(Integer.parseInt(request.getParameter("principal")));
interest.setInterest(Double.parseDouble(request.getParameter("interestRate")));
interest.setYear(Integer.parseInt(request.getParameter("year"))); OrInterestService orInterestService = new OrInterestService(); // I_InterestService compoundInterestService = new SingleInterestService();
// System.out.println(compoundInterestService.calculate(interest)); String compound = orInterestService.orInterest(request.getParameter("interest"),interest);
if(compound != null ){
request.getSession().setAttribute("compound",compound);
RequestDispatcher rd = request.getRequestDispatcher("/Jsp/successInterest.jsp");
rd.forward(request,response);
}
} protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}

  

利率计算--web版--软件工程的更多相关文章

  1. 复利计算--web版--总结--软件工程

    复利计算项目 估计用时 实际用时 时间(小时) 5.5小时  6.5小时 总共代码行 500  550 功能包含 单利/复利计算,本金计算,求投资年限,求投资项目利率估计 (计算利息和,计算时间,计算 ...

  2. 利率计算v2.0--web版--软件工程

    .客户说:帮我开发一个复利计算软件. .如果按照单利计算,本息又是多少呢? .假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? .利率这么低,复利计算 ...

  3. 利率计算v5.0--结对--软件工程

    利率计算v5.--测试--软件工程 1.任务结对同伴: 名字:王昕明 学号: 博客地址 :http://home.cnblogs.com/u/xinmingwang/ Git : https://gi ...

  4. 利率计算v4.0--测试--软件工程

    利率计算v4.0--测试 package Test; import Model.Interest; import Service.CompoundInterestService; import Ser ...

  5. 结对2.0--复利计算WEB升级版

    结对2.0--复利计算WEB升级版 复利计算再升级------------------------------------------------------------ 客户在大家的引导下,有了更多 ...

  6. 复利计算- 结对2.0--复利计算WEB升级版

    客户在大家的引导下,有了更多的想法: 这个数据我经常会填.....帮我预先填上呗?...... 把界面做得简单漂亮好操作一点呗? 能不能帮我转成个APP,我装到手机上就更方便了? 我觉得这个很有用,很 ...

  7. Web版的各种聊天工具

    直到近期为止,我们经常使用的即时聊天工具(QQ.msn等)了Web版,大家不用下载庞大软件,直接打开网页就能够与自己的好友聊天,非常方便.在此将时汇总        便于大家查找        节约大 ...

  8. 几款web版整合(QQ、msn、icq、yahoo通、Gtalk等)即时聊天http://hi.baidu.com/ejie/blog/item/e89794ef9a9431efce1b3ebd.html

        直到近期为止,我们经常使用的即时聊天工具(QQ.msn等)了Web版,大家不用下载庞大软件,直接打开网页就能够与自己的好友聊天,很方便.在此将时汇总,便于大家查找,节约大家一点时间. 此都是官 ...

  9. JAVA面向对象编程课程设计——web版斗地主

    一.团队课程设计博客链接 JAVA面向对象编程课程设计--网络版单机斗地主 二.个人负责模块或任务说明 实体类的设计 斗地主规则的实现 人机自动出牌的算法 实现数据库的DAO模式 三.自己的代码提交记 ...

随机推荐

  1. Jmeter-Critical Section Controller(临界区控制器)

    The Critical Section Controller ensures that its children elements (samplers/controllers, etc.) will ...

  2. 每天一个linux命令(性能、优化):【转载】lsof命令

    lsof(list open files)是一个列出当前系统打开文件的工具.在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规数据,还可以访问网络连接和硬件.所以如传输控制协议 ...

  3. DesignPattern(五)行为型模式(上)

    行为型模式 行为型模式是对在不同对象之间划分责任和算法的抽象化.行为模式不仅仅关于类和对象,还关于它们之间的相互作用.行为型模式又分为类的行为模式和对象的行为模式两种. 类的行为模式——使用继承关系在 ...

  4. oracle之 Oracle归档日志管理

    在Oracle中,数据一般是存放在数据文件中,不过数据库与Oracle最大的区别之一就是数据库可以在数据出错的时候进行恢复.这个也就是我们常见的Oracle中的重做日志(REDO FILE)的功能了. ...

  5. 中兴 F412 超级帐号telecomadmin破解(适用2015版h啊RowCount="0") TEWA-300AI EPON TEWA-500AI EPON破解

    1.telnet 192.168.1.1 root/Zte521    有些密码也是root 2.输入sendcmd 1 DB p UserInfo 老本大多数教程会返回超级管理员帐号密码: < ...

  6. 闲扯淡笔记 - Web的历史

    这里的Web指的是万维网,就是World Wide Web. 文档和静态资源 通过URL组织 Tim Berners Lee (TimBL) 于1989发明这个概念,这丫55年出生,和我父亲一般大. ...

  7. 安装memcached服务 和 php 安装memcache扩展

    这是所有的命令,至于哪个命令是干嘛的自己悟去吧  ,顺便穿插一些知识点 安装libevent cd /home/ wget  http://www.monkey.org/~provos/libeven ...

  8. redis 操作大全 PHP-redis中文文档

    转自  : http://www.cnblogs.com/weafer/archive/2011/09/21/2184059.html phpredis是php的一个扩展,效率是相当高有链表排序功能, ...

  9. nginix.conf 中的gzip模块设置

    gizp模块配置 gzip  on;    gzip_min_length  1k;    gzip_buffers     4 16k;    gzip_http_version 1.0;    g ...

  10. C#中XML文档注释编译DLL引用到其它项目

    引用地址:http://zhidao.baidu.com/link?url=jSGYEBysE4gBExtNsHCVk3vd2OK2cMlaf02cS79GdRuGueTBdFJB0btOdBYkg_ ...