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. 20155317 2016-2017-2 《Java程序设计》第8周学习总结

    20155317 2016-2017-2 <Java程序设计>第8周学习总结 教材学习内容总结 1.java.util.logging包提供了日志功能相关类与接口. 2.使用日志的起点是L ...

  2. mysql master master slave 环境搭建

    master1:192.168.128.47 master2:192.168.128.96 slave:192.168.128.97   master1与master2互备,master2作为slav ...

  3. staltStack安装配置

    http://www.cnblogs.com/kevingrace/p/5570290.html

  4. (转)powerdesigner 生成sql脚本使用的设置

    本文转载自:http://blog.163.com/lizhihaoo@126/blog/static/103121661201036171115/ 1. 生成sql脚本的时候,提示"con ...

  5. Plex音乐名称乱码原因id3版本

    标签编码支持情况: ID3v1:ISO-8859-1ID3v2 2.3:ISO-8859-1.UTF-16ID3v2 2.4:ISO-8859-1.UTF-16.UTF-8APEv2:UTF-8 修改 ...

  6. centos软件安装

    首先安装epel,然后再安装yum加速 #centos7下执行以下命令 wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7. ...

  7. pm无力的话

    1. 先这样做吧, 等不行再改 2. 用户的需求不明确, 他们对于自己的业务也不明白, 现在是我们在帮助他们缕清自己的业务, 这个迭代的过程中,有很多问题,我们程序员既不能参与到业务, 也不能猜测业务 ...

  8. 配置myslq提示 the configuration step starting server is taking longer than expected we apologize for thi

    .卸载重新安装,勾选日志配置选项,自定义日志输出路径

  9. python新里程

    为什么要学Python: 2018年6月开始自学Python.因为自己目前做Linux运维,感觉自己还需要掌握一门开发语言,在Java.python.php之间毫不犹豫的选择了Python,因为Pyt ...

  10. Spring cloud Hystrix使用@HystrixCommand使用Hystrix组件及@EnableCircuitBreaker原理介绍

    通过@HystrixCommand注解实现在Spring Cloud使用Hystrix组件相关的工程 cloud-registration-center:注册中心 cloud-service-hyst ...