复利计算器-结对编程1.1

import java.awt.*;
import java.awt.event.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import javax.swing.*;

public class calcutor extends JFrame {

    /**
     *
     */

    private static final long serialVersionUID = 1L;
    File file1 = new File("fuli.txt");
    File file2 = new File("danli.txt");
    File file3 = new File("benjin.txt");
    File file4 = new File("lilv.txt");
    File file5 = new File("nianxian.txt");
    File file6 = new File("yuehuankuan.txt");

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        calcutor frame = new calcutor();
        frame.setVisible(true);
        frame.setBounds(100, 100, 500, 600);
        frame.setTitle("计算器3.1");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }

    private JPanel jpanel;
    private JLabel label, label00, label01, label02, label03, label04, label05, label06,label07,label08,label09,label10,label11;
    private JComboBox<Object> box;
    private JTextField field01, field02, field03, field04, field05;
    private JButton button;
    private static double benjin, lilv, nianxian, zhongzhi, dingtou, huankuan, daikuan;
    private int index = 0;

    public calcutor() {

        jpanel = new JPanel();
        jpanel.setBounds(0, 0, 500, 600);
        jpanel.setLayout(null);
        add(jpanel);

        label = new JLabel("计算类型:");
        label.setFont(new Font(null, Font.BOLD, 15));
        label.setBounds(10, 10, 80, 30);
        jpanel.add(label);

        label06 = new JLabel();
        label06.setBounds(10, 320, 500, 40);
        jpanel.add(label06);

        label07 = new JLabel();
        label07.setBounds(10, 350, 500, 40);
        jpanel.add(label07);

        label08 = new JLabel();
        label08.setBounds(10, 380, 500, 40);
        jpanel.add(label08);

        label09 = new JLabel();
        label09.setBounds(10, 410, 500, 40);
        jpanel.add(label09);

        label10 = new JLabel();
        label10.setBounds(10, 440, 500, 40);
        jpanel.add(label10);

        label11 = new JLabel();
        label11.setBounds(10, 470, 500, 40);
        jpanel.add(label11);

        label00 = new JLabel("@113wangzekai、114jihan");
        label00.setFont(new Font(null, Font.BOLD, 15));
        label00.setBounds(290, 520, 200, 30);
        jpanel.add(label00);

        label01 = new JLabel("本金:");
        label01.setFont(new Font(null, Font.BOLD, 15));
        label01.setBounds(30, 80, 80, 30);
        jpanel.add(label01);

        label02 = new JLabel("年利率%:");
        label02.setFont(new Font(null, Font.BOLD, 15));
        label02.setBounds(30, 130, 80, 30);
        jpanel.add(label02);

        label03 = new JLabel("年限:");
        label03.setFont(new Font(null, Font.BOLD, 15));
        label03.setBounds(30, 180, 80, 30);
        jpanel.add(label03);

        label04 = new JLabel("定投金额:");
        label04.setFont(new Font(null, Font.BOLD, 15));
        label04.setBounds(30, 230, 80, 30);
        jpanel.add(label04);

        label05 = new JLabel("终值:");
        label05.setFont(new Font(null, Font.BOLD, 15));
        label05.setBounds(30, 280, 80, 30);
        jpanel.add(label05);

        // 文本框
        field01 = new JTextField();
        field01.setBounds(120, 80, 150, 30);
        jpanel.add(field01);

        field02 = new JTextField("0.03");
        field02.setBounds(120, 130, 150, 30);
        jpanel.add(field02);

        field03 = new JTextField();
        field03.setBounds(120, 180, 150, 30);
        jpanel.add(field03);

        field04 = new JTextField();
        field04.setBounds(120, 230, 150, 30);
        jpanel.add(field04);

        field05 = new JTextField();
        field05.setBounds(120, 280, 150, 30);
        jpanel.add(field05);

        // 初始化文本框
        field05.setText("计算所得");
        field05.setEnabled(false);

        // 计算按钮
        button = new JButton("计算");
        button.setBounds(250, 10, 80, 30);
        button.setFont(new Font(null, Font.BOLD, 15));
        jpanel.add(button);
        // 按钮监听
        button.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (index == 0) {
                    zhongzhi = fulicalcutor();
                    if (zhongzhi != -1) {
                        field05.setText(Double.toString(zhongzhi));
                        field05.setEnabled(true);
                    }
                } else if (index == 1) {
                    zhongzhi = danlicalcutor();
                    if (zhongzhi != -1) {
                        field04.setText(Double.toString(zhongzhi));
                        field04.setEnabled(true);
                    }
                } else if (index == 2) {
                    benjin = benjincalcutor();
                    if (benjin != -1) {
                        field01.setText(Double.toString(benjin));
                        field01.setEnabled(true);
                    }
                } else if (index == 3) {
                    lilv = lilvcalcutor();
                    if (lilv != -1) {
                        field02.setText(Double.toString(lilv));
                        field02.setEnabled(true);
                    }
                } else if (index == 4) {
                    nianxian = nianxiancalcutor();
                    if (nianxian != -1) {
                        field03.setText(Double.toString(nianxian));
                        field03.setEnabled(true);
                    }
                } else if (index == 5) {
                    huankuan = yuehuankuanejisuan();
                    if (huankuan != -1) {
                        field04.setText(Double.toString(huankuan));
                        field04.setEnabled(true);
                    }
                }
            }
        });

        // 下拉菜单
        box = new JComboBox<>();
        box.setFont(new Font(null, Font.BOLD, 15));
        box.setModel(
                new DefaultComboBoxModel<Object>(new Object[] { "复利计算", "单利计算", "本金计算", "利率计算", "年限计算", "月还款额计算" }));
        box.setBounds(90, 10, 130, 30);
        jpanel.add(box);
        box.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (box.getSelectedIndex() == 0) {
                    index = 0;
                    change01();
                    clear();
                    field02.setText("0.03");
                    field05.setText("计算所得");
                    field05.setEnabled(false);
                    // System.out.println("复利计算");
                } else if (box.getSelectedIndex() == 1) {
                    index = 1;
                    change();
                    clear();
                    field02.setText("0.03");
                    field04.setText("计算所得");
                    field04.setEnabled(false);
                    // System.out.println("单利计算");
                } else if (box.getSelectedIndex() == 2) {
                    index = 2;
                    change();
                    clear();
                    field02.setText("0.03");
                    field01.setText("计算所得");
                    field01.setEnabled(false);
                    // System.out.println("本金计算");
                } else if (box.getSelectedIndex() == 3) {
                    index = 3;
                    change();
                    clear();
                    field02.setText("计算所得");
                    field02.setEnabled(false);
                    // System.out.println("利率计算");
                } else if (box.getSelectedIndex() == 4) {
                    index = 4;
                    change();
                    clear();
                    field02.setText("0.03");
                    field03.setText("计算所得");
                    field03.setEnabled(false);
                } else if (box.getSelectedIndex() == 5) {
                    index = 5;
                    change02();
                    clear();
                    field04.setText("计算所得");
                    field04.setEnabled(false);
                }
            }

        });
    }

    // 清除数据
    private void clear() {
        field01.setText(null);
        field02.setText(null);
        field03.setText(null);
        field04.setText(null);
        field05.setText(null);
        field01.setEnabled(true);
        field02.setEnabled(true);
        field03.setEnabled(true);
        field04.setEnabled(true);
        field05.setEnabled(true);
    }

    // 改变内容
    private void change02() {
        label01.setText("贷款金额:");
        label02.setText("年利率%:");
        label03.setText("还款期限:");
        label04.setText("月还款额:");
        label05.setText("");
        field05.setVisible(false);
    }

    private void change01() {
        label01.setText("本金:");
        label02.setText("年利率%:");
        label03.setText("年限:");
        label04.setText("定投金额:");
        label05.setText("终值:");
        field05.setVisible(true);
    }

    private void change() {
        label01.setText("本金:");
        label02.setText("年利率%:");
        label03.setText("年限:");
        label04.setText("终值:");
        label05.setText("");
        field05.setVisible(false);
    }

    // 月还款额计算
    private double yuehuankuanejisuan() {
        try {
            daikuan = Double.parseDouble(field01.getText());
            lilv = Double.parseDouble(field02.getText());
            nianxian = Double.parseDouble(field03.getText());

            // 小于或等于0的处理
            if (daikuan <= 0 || lilv <= 0 || nianxian <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {
                double yuehuankuan = yuehuankuan(daikuan, lilv, nianxian);
                try {
                    FileOutputStream fos = new FileOutputStream(file6);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("月还款额计算:");
                    bw.write(" 贷款:"+daikuan);
                    bw.write(" 利率:"+lilv);
                    bw.write(" 年限:"+nianxian);
                    bw.write(" 月还款额:"+yuehuankuan);

                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("yuehuankuan.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label11.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                return yuehuankuan;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }
        return -1;

    }

    // 月还款额的计算公式
    public final double yuehuankuan(double daikuan, double lilv, double nianxian) {
        huankuan = daikuan * (lilv / 12) * Math.pow(1 + lilv / 12, 12 * nianxian)
                / (Math.pow(1 + lilv / 12, 12 * nianxian) - 1);
        huankuan = Math.round(huankuan * 100) / 100;
        return huankuan;
    }

    // 年限计算
    private double nianxiancalcutor() {
        try {
            zhongzhi = Double.parseDouble(field04.getText());
            lilv = Double.parseDouble(field02.getText());
            benjin = Double.parseDouble(field01.getText());

            // 小于或等于0的处理
            if (zhongzhi <= 0 || lilv <= 0 || benjin <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {
                double nianxian = nianxian(zhongzhi, lilv, benjin);
                try {
                    FileOutputStream fos = new FileOutputStream(file5);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("年限计算:");
                    bw.write(" 本金:"+benjin);
                    bw.write(" 利率:"+lilv);
                    bw.write(" 终值:"+zhongzhi);
                    bw.write(" 年限:"+nianxian);
                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("nianxian.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label10.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return nianxian;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }
        return -1;
    }

    // 年限的计算公式
    public final double nianxian(double zhongzhi, double lilv, double benjin) {
        nianxian = (Math.log(zhongzhi / benjin) / Math.log(1 + lilv));
        nianxian = Math.round(nianxian);
        return nianxian;
    }

    // 利率计算
    private double lilvcalcutor() {
        try {
            zhongzhi = Double.parseDouble(field04.getText());
            nianxian = Double.parseDouble(field03.getText());
            benjin = Double.parseDouble(field01.getText());

            // 小于或等于0的处理
            if (zhongzhi <= 0 || benjin <= 0 || nianxian <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {
                double lilv = lilv(zhongzhi, nianxian, benjin);
                try {
                    FileOutputStream fos = new FileOutputStream(file4);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("利率计算:");
                    bw.write(" 终值:"+zhongzhi);
                    bw.write(" 年限:"+nianxian);
                    bw.write(" 本金:"+benjin);
                    bw.write(" 利率:"+lilv);

                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("lilv.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label09.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return lilv;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }
        return -1;
    }

    // 利率的计算公式
    public final double lilv(double zhongzhi, double nianxian, double benjin) {
        lilv = Math.pow((zhongzhi / benjin), (1.0 / nianxian)) - 1;
        lilv = Math.round(lilv * 100) / 100.0;
        return lilv;
    }

    // 本金计算
    private double benjincalcutor() {
        try {
            zhongzhi = Double.parseDouble(field04.getText());
            lilv = Double.parseDouble(field02.getText());
            nianxian = Double.parseDouble(field03.getText());

            // 小于或等于0的处理
            if (zhongzhi <= 0 || lilv <= 0 || nianxian <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {

                double benjin = benjin(zhongzhi, lilv, nianxian);
                try {
                    FileOutputStream fos = new FileOutputStream(file3);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("本金计算:");
                    bw.write(" 终值:"+zhongzhi);
                    bw.write(" 利率:"+lilv);
                    bw.write(" 年限:"+nianxian);
                    bw.write(" 本金:"+benjin);

                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("benjin.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label08.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return benjin;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }
        return -1;
    }

    // 本金的计算公式
    public final double benjin(double zhongzhi, double lilv, double nianxian) {
        benjin = zhongzhi / (Math.pow(1 + lilv, nianxian));
        benjin = Math.round(benjin * 100) / 100;
        return benjin;
    }

    // 单利计算
    private double danlicalcutor() {
        try {
            benjin = Double.parseDouble(field01.getText());
            lilv = Double.parseDouble(field02.getText());
            nianxian = Double.parseDouble(field03.getText());

            // 小于或等于0的处理
            if (benjin <= 0 || lilv <= 0 || nianxian <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {
                double zhongzhi=zhongzhi(benjin, lilv, nianxian);
                try {
                    FileOutputStream fos = new FileOutputStream(file2);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("单利计算:");
                    bw.write(" 本金:"+benjin);
                    bw.write(" 利率:"+lilv);
                    bw.write(" 年限:"+nianxian);
                    bw.write(" 终值:"+zhongzhi);

                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("danli.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label07.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                return zhongzhi;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }
        return -1;

    }

    // 单利的计算公式
    public final double zhongzhi(double benjin, double lilv, double nianxian) {
        zhongzhi = benjin * (1 + lilv * nianxian);
        zhongzhi = Math.round(zhongzhi * 100) / 100;
        return zhongzhi;
    }

    // 复利计算
    private double fulicalcutor() {

        try {
            benjin = Double.parseDouble(field01.getText());
            lilv = Double.parseDouble(field02.getText());
            nianxian = Double.parseDouble(field03.getText());

            try {
                dingtou = Double.parseDouble(field04.getText());
            } catch (NumberFormatException e2) {
                dingtou = 0;
            }

            // 小于或等于0的处理
            if (benjin <= 0 || lilv <= 0 || nianxian <= 0) {
                JOptionPane.showMessageDialog(jpanel, "你输入的数据不能小于或等于零\n" + "               请重新输入");
            } else {
                double zhongzhi=zhongzhi(benjin, lilv, nianxian, dingtou);

                try {
                    FileOutputStream fos = new FileOutputStream(file1);
                    OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
                    BufferedWriter bw = new BufferedWriter(osw);

                    bw.write("复利计算:");
                    bw.write(" 本金:"+benjin);
                    bw.write(" 利率:"+lilv);
                    bw.write(" 年限:"+nianxian);
                    bw.write(" 定投金额:"+dingtou);
                    bw.write(" 终值:"+zhongzhi);

                    bw.close();
                    osw.close();
                    fos.close();

                } catch (FileNotFoundException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                String line = null;
                try {
                    FileInputStream fis = new FileInputStream("fuli.txt");
                    InputStreamReader isr = new InputStreamReader(fis);
                    BufferedReader br = new BufferedReader(isr);

                    try {
                        while ((line = br.readLine()) != null) {
                            System.out.println(line);
                            label06.setText(line);
                        }
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    try {
                        br.close();
                        isr.close();
                        fis.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                return zhongzhi;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(jpanel, "请输入正确的数据");
            // System.out.println("请输入数据");
        }

        return -1;
    }

    // 复利的计算公式
    public final double zhongzhi(double benjin, double lilv, double nianxian, double dingtou) {
        for (int i = 0; i < nianxian; i++) {
            benjin = benjin * (1 + lilv);
            benjin = benjin + dingtou;
        }
        zhongzhi = benjin - dingtou;
        zhongzhi = Math.round(zhongzhi * 100) / 100;
        return zhongzhi;
    }

}

  本次结对更新主要更新了对于客户经常会输入的数据的默认值,主要是在操作前先对默认的数据进行初始化,总的实现过程并不难,对于其他要求,本人和队友的水平暂时还没有学习到那种程度,所以没有办法实现。

时间: 2024-10-22 08:18:28

复利计算器-结对编程1.1的相关文章

复利计算器--结对编程

import java.awt.*; import java.awt.event.*; import java.io.*; import javax.swing.*; public class calcutor extends JFrame { private static final long serialVersionUID = 1L; File file1 = new File("fuli.txt"); File file2 = new File("danli.txt&

0406 复利计算器--结对 组员 韩麒麟 列志华

一.主要功能与需求分析 1.本金为100万,利率或者投资回报率为3%,投资年限为30年,那么,30年后所获得的利息收入:按复利计算公式来计算就是:1,000,000×(1+3%)^30 2.如果按照单利计算,本息的最终收益 3.假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? 4.利率这么低,复利计算收益都这么厉害了,如果拿100万元去买年报酬率10%的股票,若一切顺利,过多长时间,100万元就变成200万元呢? 5.如果我希望在十年内将100万

复利计算——结对编程2.0

复利计算再升级---------------------------------------------------------------------------------------------------------------------- 客户在大家的引导下,有了更多的想法: 这个数据我经常会填.....帮我预先填上呗? 把界面做得简单漂亮好操作一点呗? 能不能帮我转成个APP,我装到手机上就更方便了? 我觉得这个很有用,很多人可能都需要这些功能,做到我的微信公众号上吧? 能不能不要

复利计算器--结对2.0

结对项目:复利计算 搭档:30蔡京航  http://www.cnblogs.com/cjh123/ github:https://github.com/alfredzhu/teamwork 客户在大家的引导下,有了更多的想法: 这个数据我经常会填.....帮我预先填上呗?...... 把界面做得简单漂亮好操作一点呗? 能不能帮我转成个APP,我装到手机上就更方便了? 我觉得这个很有用,很多人可能都需要这些功能,做到我的微信公众号上吧? 能不能不要让我填表单,让我发条消息,或者对着手机说句话就可

复利计算——结对编程

1.任务 即要追求利益,又要面对不可预知的金融投资风险, “不能把鸡蛋放在同一个篮子里”,所以有必要进行组合投资. 通过上述计算与对比,可以帮助客户进行投资决策. 客户:那么能否帮我记录下一笔一笔不同类型的投资,并动态显示资金现值呢? 1 resultList.setVisibleRowCount(5); //默认在JList中的显示条数为5条 2 c.add(new JScrollPane(resultList)); 3 resultList.setForeground(Color.BLACK

复利计算5.0—结对编程

结对同伴: 名字:蔡舜 学号:201406114220 博客地址:http://www.cnblogs.com/caishun/ github地址:https://github.com/ShunC/InterestRateCalculation 工作照片: 1.任务 即要追求利益,又要面对不可预知的金融投资风险, “不能把鸡蛋放在同一个篮子里”,所以有必要进行组合投资. 通过上述计算与对比,可以帮助客户进行投资决策. 客户:那么能否帮我记录下一笔一笔不同类型的投资,并动态显示资金现值呢? 2.开

结对编程总结

1.结对编程题目是:面向小学生,随机生成30个100以内的四则运算,并且用户可以录入结果,检查用户录入的结果是否是正确的. 2.结对编程对象:叶小娟,代码共计:326行 3. 4.代码 #include <stdio.h> //计算器 #include <malloc.h> #include <stdlib.h> #define STACK_SIZE 100 //max size of the stack #define STACK_INCREMENT 10 //rea

复利计算--结对

复利计算之结对 结对同伴的学号:201406114245 姓名:赵创佳 博客地址:http://www.cnblogs.com/7763255qw/ :github地址: https://github.com/zhaochuangjia 程序源代码已上传至https://github.com/ganjiaping 源程序的文件名为:teaml.cpp; 一.项目简介 项目名称:复利计算 版  本  :5.0 版本类型:c 使用工具:Visual c++ 6.0 主要功能:复利单利的计算.贷款的计

复利计算器(软件工程)及Junit测试———郭志豪

计算:1.本金为100万,利率或者投资回报率为3%,投资年限为30年,那么,30年后所获得的利息收入:按复利计算公式来计算就是:1,000,000×(1+3%)^30 客户提出: 2.如果按照单利计算,本息又是多少呢? 3.假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? 4.利率这么低,复利计算收益都这么厉害了,如果拿100万元去买年报酬率10%的股票,若一切顺利,过多长时间,100万元就变成200万元呢? 5.如果我希望在十年内将100万元变