结对同伴:
学号:201406114105
姓名:董婷婷
博客地址:http://home.cnblogs.com/u/babys8023/
一、项目需求:
即要追求利益,又要面对不可预知的金融投资风险, “不能把鸡蛋放在同一个篮子里”,所以有必要进行组合投资。
通过上述计算与对比,可以帮助客户进行投资决策。
客户:那么能否帮我记录下一笔一笔不同类型的投资,并动态显示资金现值呢?
二、项目估计完成时间与实际完成时间
估计完成时间:5h
实际完成时间:3h
三、主要代码
1 public void Invest_Panel_Design() { 2 label_9 = new JLabel("\u6211\u7231\u6295\u8D44\u7406\u8D22"); 3 label_9.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 18)); 4 label_9.setBounds(124, 25, 144, 25); 5 Invest_Panel.add(label_9); 6 7 label_10 = new JLabel("\u6295\u8D44\u91D1\u989D\uFF1A"); 8 label_10.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 16)); 9 label_10.setBounds(28, 99, 88, 15);10 Invest_Panel.add(label_10);11 12 label_11 = new JLabel("\u6295\u8D44\u5E74\u9650\uFF1A");13 label_11.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 16));14 label_11.setBounds(30, 162, 81, 15);15 Invest_Panel.add(label_11);16 17 Invest_money_tf = new JTextField();18 Invest_money_tf.setBounds(149, 98, 106, 21);19 Invest_Panel.add(Invest_money_tf);20 Invest_money_tf.setColumns(10);21 22 Invest_year_tf = new JTextField();23 Invest_year_tf.setBounds(149, 161, 106, 21);24 Invest_Panel.add(Invest_year_tf);25 Invest_year_tf.setColumns(10);26 27 Invest_rate_tf = new JTextField();28 Invest_rate_tf.setBounds(149, 207, 106, 21);29 Invest_Panel.add(Invest_rate_tf);30 Invest_rate_tf.setColumns(10);31 32 Invest_money_tf.addKeyListener(keyAdapter);33 Invest_year_tf.addKeyListener(keyAdapter); 34 Invest_rate_tf.addKeyListener(keyAdapter);35 36 37 label_12 = new JLabel("\u5230\u671F\u672C\u606F\uFF1A");38 label_12.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 16));39 label_12.setBounds(19, 301, 97, 15);40 Invest_Panel.add(label_12);41 42 JButton button = new JButton("\u8BA1\u7B97\u7ED3\u679C");43 button.addMouseListener(new MouseAdapter() {44 button.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 16));45 button.setBounds(5, 234, 106, 23);46 Invest_Panel.add(button);47 48 JLabel label = new JLabel("\u5355\u5229\uFF1A");49 label.setFont(new Font("宋体", Font.PLAIN, 14));50 label.setBounds(107, 276, 54, 15);51 Invest_Panel.add(label);52 53 JLabel label_13 = new JLabel("\u590D\u5229\uFF1A");54 label_13.setFont(new Font("宋体", Font.PLAIN, 14));55 label_13.setBounds(106, 326, 54, 15);56 Invest_Panel.add(label_13);57 58 label_14 = new JLabel("\u5229\u7387(%)\uFF1A");59 label_14.setFont(new Font("Microsoft JhengHei", Font.PLAIN, 16));60 label_14.setBounds(34, 209, 77, 15);61 Invest_Panel.add(label_14);62 63 Invest_simple_tf = new JTextField();64 Invest_simple_tf.setBounds(149, 273, 106, 21);65 Invest_Panel.add(Invest_simple_tf);66 Invest_simple_tf.setColumns(10);67 68 Invest_compound_tf = new JTextField();69 Invest_compound_tf.setBounds(149, 323, 106, 21);70 Invest_Panel.add(Invest_compound_tf);71 Invest_compound_tf.setColumns(10);72 }
代码链接:https://github.com/LinWenFeng/CompoundInterest
四、功能实现结果
五、结对工作时的照片
六、分工
我主要是负责编写实现这个功能的代码,而我的同伴是督促我的进度和发现代码中的小错误和进行数据测试。
七、总结
在此次结对编程过程中,我主要负责编写实现功能的代码,同伴帮忙查找错误和测试数据,这样能够减少花费的精力和时间。