日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

全国小学四则运算1.0

發布時間:2023/12/18 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 全国小学四则运算1.0 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

程序:全國小學四則運算1.0

源代碼:

import javax.swing.*; import java.awt.*; import java.awt.event.*; //一開始的界面 public class Menu extends JFrame implements ActionListener{JButton enter;public Menu(){super("小學生四則運算大考驗");setIconImage(Toolkit.getDefaultToolkit().getImage(Menu.class.getResource("/img/33.jpg")));this.setSize(578, 516);this.setLocation(350, 50);//主窗口位置this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setResizable(true);ImageIcon img=new ImageIcon(this.getClass().getResource("img/enterimg.png"));enter = new JButton("New button");enter.setIcon(img);getContentPane().add(enter, BorderLayout.CENTER);enter.addActionListener(this);this.setVisible(true);}public static void main(String[] args){new Menu();}@Overridepublic void actionPerformed(ActionEvent e) {if(e.getSource()==enter){this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);this.setVisible(false);Question question=new Question();}} } import java.awt.event.*;import javax.swing.*; import javax.swing.border.LineBorder;import java.awt.*; import java.math.*; import java.text.*; import java.util.regex.Pattern; //輸入題量的對話框 ,檢查對話框,出題的界面,檢查答案是否規范的對話框 public class Question extends JFrame implements ActionListener {public static String s[] = new String[5];static String tmnum;// 題目個數static int n;// 題目數量int[] num1 = new int[5];static int num2;// 階乘的數static String[] useranser = new String[5];// 用戶輸入的答案static String[] staticanser = new String[5];// 標準答案static DecimalFormat decimal = new DecimalFormat("#.##");static JTextField[] textField = new JTextField[5];static JButton btnNewButton;static JButton button;static JButton hybutton;static JPanel panel;static JPanel p1;static Question q1;static int hycs = 1;Pattern pattern = Pattern.compile("[0-9]*");Question() {super("測試中......");setIconImage(Toolkit.getDefaultToolkit().getImage(Question.class.getResource("/img/33.jpg")));getContentPane().setBackground(new Color(255, 255, 0));setBackground(new Color(255, 255, 255));setForeground(new Color(255, 255, 255));this.setSize(499, 383);this.setLocation(350, 50);// 主窗口位置this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setResizable(true);tmnum = JOptionPane.showInputDialog("請輸入題目個數(1~5):");do {if (pattern.matcher(tmnum).matches()) {// 如果輸入的是數字就執行n = Integer.parseInt(tmnum);while (n <= 0 || n >= 6) {tmnum = JOptionPane.showInputDialog("輸入錯誤!請重新輸入題目個數(1~5):");n = Integer.parseInt(tmnum);}break;} else {tmnum = JOptionPane.showInputDialog("輸入錯誤!請重新輸入題目個數(1~5):");}} while (true);// 輸入題目JLabel[] tm = new JLabel[5];p1 = new JPanel();p1.setForeground(new Color(0, 0, 0));p1.setBackground(new Color(253, 245, 230));getContentPane().add(p1, BorderLayout.CENTER);GridBagLayout gbl_p1 = new GridBagLayout();gbl_p1.columnWidths = new int[] { 0, 0, 0 };gbl_p1.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };gbl_p1.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };gbl_p1.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };p1.setLayout(gbl_p1);Question.timu(n, num1);JLabel label_5 = new JLabel("全國高等小學四則運算練習系統1.0");label_5.setFont(new Font("仿宋", Font.BOLD, 27));GridBagConstraints gbc_label_5 = new GridBagConstraints();gbc_label_5.gridwidth = 2;gbc_label_5.insets = new Insets(0, 0, 10, 0);gbc_label_5.gridx = 0;gbc_label_5.gridy = 0;p1.add(label_5, gbc_label_5);JLabel label = new JLabel(s[0]);// 第一題標簽label.setBackground(new Color(144, 238, 144));label.setFont(new Font("Batang", Font.PLAIN, 24));label.setHorizontalAlignment(SwingConstants.LEFT);GridBagConstraints gbc_label = new GridBagConstraints();gbc_label.anchor = GridBagConstraints.SOUTH;gbc_label.fill = GridBagConstraints.HORIZONTAL;gbc_label.insets = new Insets(0, 20, 20, 0);gbc_label.gridx = 0;gbc_label.gridy = 1;// label p1.add(label, gbc_label);JLabel label_1 = new JLabel(s[1]);// 第二題標簽label_1.setFont(new Font("Batang", Font.PLAIN, 24));label_1.setHorizontalAlignment(SwingConstants.LEFT);GridBagConstraints gbc_label_1 = new GridBagConstraints();gbc_label_1.fill = GridBagConstraints.HORIZONTAL;gbc_label_1.insets = new Insets(0, 20, 20, 0);gbc_label_1.gridx = 0;gbc_label_1.gridy = 2;p1.add(label_1, gbc_label_1);JLabel label_2 = new JLabel(s[2]);// 第三題標簽label_2.setFont(new Font("Batang", Font.PLAIN, 24));label_2.setHorizontalAlignment(SwingConstants.LEFT);GridBagConstraints gbc_label_2 = new GridBagConstraints();gbc_label_2.fill = GridBagConstraints.HORIZONTAL;gbc_label_2.insets = new Insets(0, 20, 20, 0);gbc_label_2.gridx = 0;gbc_label_2.gridy = 3;p1.add(label_2, gbc_label_2);JLabel label_3 = new JLabel(s[3]);// 第四題標簽label_3.setFont(new Font("Batang", Font.PLAIN, 24));label_3.setHorizontalAlignment(SwingConstants.LEFT);GridBagConstraints gbc_label_3 = new GridBagConstraints();gbc_label_3.fill = GridBagConstraints.HORIZONTAL;gbc_label_3.insets = new Insets(0, 20, 20, 0);gbc_label_3.gridx = 0;gbc_label_3.gridy = 4;p1.add(label_3, gbc_label_3);JLabel label_4 = new JLabel(s[4]);// 第5題標簽label_4.setFont(new Font("Batang", Font.PLAIN, 24));label_4.setHorizontalAlignment(SwingConstants.LEFT);GridBagConstraints gbc_label_4 = new GridBagConstraints();gbc_label_4.insets = new Insets(0, 20, 20, 0);gbc_label_4.fill = GridBagConstraints.HORIZONTAL;gbc_label_4.gridx = 0;gbc_label_4.gridy = 5;p1.add(label_4, gbc_label_4);for (int j = 0; j < n; j++) {textField[j] = new JTextField(10);GridBagConstraints gbc_textField = new GridBagConstraints();gbc_textField.anchor = GridBagConstraints.SOUTH;gbc_textField.insets = new Insets(0, 0, 20, 10);gbc_textField.fill = GridBagConstraints.HORIZONTAL;gbc_textField.gridx = 1;gbc_textField.gridy = j + 1;textField[j].setColumns(10);p1.add(textField[j], gbc_textField);}panel = new JPanel();panel.setBackground(new Color(253, 245, 230));getContentPane().add(panel, BorderLayout.SOUTH);GridBagLayout gbl_panel = new GridBagLayout();gbl_panel.columnWidths = new int[] { 0, 0, 57, 57, 0 };gbl_panel.rowHeights = new int[] { 23, 0 };gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0,Double.MIN_VALUE };gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };panel.setLayout(gbl_panel);btnNewButton = new JButton("提交");// 提交按鈕btnNewButton.setBackground(new Color(255, 228, 225));GridBagConstraints gbc_btnNewButton = new GridBagConstraints();gbc_btnNewButton.anchor = GridBagConstraints.NORTHWEST;gbc_btnNewButton.insets = new Insets(0, 100, 20, 40);gbc_btnNewButton.gridx = 0;gbc_btnNewButton.gridy = 0;// btnNewButton.setEnabled(false); panel.add(btnNewButton, gbc_btnNewButton);button = new JButton("退出");// 退出按鈕button.setBackground(new Color(250, 250, 210));GridBagConstraints gbc_button = new GridBagConstraints();gbc_button.insets = new Insets(0, 0, 20, 40);gbc_button.anchor = GridBagConstraints.NORTHWEST;gbc_button.gridx = 1;gbc_button.gridy = 0;panel.add(button, gbc_button);hybutton = new JButton("\u62A4\u773C\u6A21\u5F0F");hybutton.setBackground(new Color(152, 251, 152));GridBagConstraints gbc_hybutton = new GridBagConstraints();gbc_hybutton.anchor = GridBagConstraints.NORTHWEST;gbc_hybutton.insets = new Insets(0, 0, 0, 5);gbc_hybutton.gridx = 2;gbc_hybutton.gridy = 0;panel.add(hybutton, gbc_hybutton);btnNewButton.addActionListener(this);button.addActionListener(this);hybutton.addActionListener(this);this.setVisible(true);}public static void timu(int max, int[] num1) {// 題目int n;char[] op = { '+', '-', '*', '/' };int[] no = new int[4];int cs;// 正負參數int ccs;// 題型參數String str = new String();for (int i = 0; i < max; i++) {ccs = (int) (Math.random() * 2);s[i] = "(" + (i + 1) + ")";n = (int) (Math.random() * 4 + 2);// 2-5個操作數if (ccs == 0) {// 一般式子計算for (int j = 0; j < n; j++) {cs = (int) (Math.random() * 2);if (cs == 0)// 負數num1[j] = -(int) (Math.random() * 100);// 控制隨機數數值else// 正數num1[j] = (int) (Math.random() * 100);// 控制隨機數數值 }for (int k = 0; k < n - 1; k++) {no[k] = (int) (Math.random() * 4);// 隨機產生操作符if (no[k] == 3 && num1[k + 1] == 0) {do {num1[k + 1] = (int) (Math.random() * 100);// 如果除號后為0,則重新取數。} while (num1[k + 1] == 0);}}for (int h = 0; h < n; h++) {if (h != n - 1) {if (num1[h] < 0)str = str + "(" + String.valueOf(num1[h]) + ")"+ String.valueOf(op[no[h]]);elsestr = str + String.valueOf(num1[h])+ String.valueOf(op[no[h]]);} else {if (num1[h] < 0)str = str + "(" + String.valueOf(num1[h]) + ")=";elsestr = str + String.valueOf(num1[h]) + "=";}}s[i] = s[i] + str;str = new String();} else// 階層式子計算 {num2 = (int) (Math.random() * 11);s[i] = "(" + (i + 1) + ")" + String.valueOf(num2) + "!=";}if (ccs == 0) {int sign; // 累加運算時的符號float left, right;// 保存蹭結果 decimal.setRoundingMode(RoundingMode.HALF_UP);// 計算標準答案left = 0;right = num1[0];sign = 1;for (int g = 0; g < n - 1; g++) {switch (op[no[g]]) {case '+':left = left + sign * right;sign = 1;right = num1[g + 1];break;case '-':left = left + sign * right;sign = -1;right = num1[g + 1];break;case '*':right = right * num1[g + 1];break;case '/':right = right / num1[g + 1];break;}}staticanser[i] = String.valueOf(decimal.format(left + sign* right));System.out.println((i + 1) + ":" + staticanser[i]);} else {int ann = 1;if (num2 == 0) {staticanser[i] = "1";} else {for (int o = 1; o <= num2; o++) {ann = ann * o;}staticanser[i] = String.valueOf(ann);}System.out.println((i + 1) + ":" + staticanser[i]);}}}public static void main(String[] args) {q1 = new Question();}@Overridepublic void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubif (e.getSource() == btnNewButton) // 提交按鈕 {for (int l = 0; l < n; l++) //獲取文本框內容useranser[l] = textField[l].getText();int flag1=0;//檢查用戶輸入是否符合范圍,是否為數字for (int l = 0; l < n; l++) {if (!pattern.matcher(textField[l].getText()).matches())// 如果輸入的是數字就執行flag1=1;}int flag = 0;//檢查用戶輸入是否為空for (int l = 0; l < n; l++) {if (textField[l].getText().isEmpty()) flag = 1;}if (flag != 1&&flag1!=1)//符合條件 {this.setDefaultCloseOperation(Question.HIDE_ON_CLOSE);this.setVisible(false);Total to = new Total();} else //為空,或者不是數字則提示錯誤 {JOptionPane.showMessageDialog(q1, "未完成題目或答案無效,請繼續答題!!", "錯誤信息",JOptionPane.ERROR_MESSAGE);}}if (e.getSource() == button)// 退出 {System.exit(0);}if (e.getSource() == hybutton) {// 護眼模式p1.setBackground(new Color(204, 255, 153));panel.setBackground(new Color(204, 255, 153));hycs = 0;}}} import javax.swing.JFrame;import java.awt.GridLayout; import java.awt.GridBagLayout;import javax.swing.JLabel;import java.awt.GridBagConstraints; import java.awt.Insets; import java.awt.Font; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;import javax.swing.JButton; import java.awt.Toolkit;//統計的頁面 public class Total extends JFrame implements ActionListener {JLabel[] lable=new JLabel[5];JLabel[] lable1=new JLabel[5];JButton restart,quit;static Total to;int count=0;Total(){super("統計");setIconImage(Toolkit.getDefaultToolkit().getImage(Total.class.getResource("/img/33.jpg")));this.setSize(499, 383);this.setLocation(350, 50);//主窗口位置this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setResizable(true);getContentPane().setBackground(new Color(253, 245, 230));if(Question.hycs==0){getContentPane().setBackground(new Color(204, 255, 153));}Question.hycs=1;GridBagLayout gridBagLayout = new GridBagLayout();gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0};gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};getContentPane().setLayout(gridBagLayout);JLabel lblNewLabel_9 = new JLabel("分數統計");lblNewLabel_9.setFont(new Font("仿宋", Font.BOLD, 30));GridBagConstraints gbc_lblNewLabel_9 = new GridBagConstraints();gbc_lblNewLabel_9.gridwidth = 2;gbc_lblNewLabel_9.insets = new Insets(0, 0, 5, 5);gbc_lblNewLabel_9.gridx = 1;gbc_lblNewLabel_9.gridy = 0;getContentPane().add(lblNewLabel_9, gbc_lblNewLabel_9);JLabel label = new JLabel("總共:"+Question.tmnum);label.setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_label = new GridBagConstraints();gbc_label.fill = GridBagConstraints.HORIZONTAL;gbc_label.anchor = GridBagConstraints.WEST;gbc_label.insets = new Insets(0, 20, 5, 30);gbc_label.gridx = 1;gbc_label.gridy = 1;getContentPane().add(label, gbc_label);int cs[]=new int[2];for(int y=0;y<Question.n;y++){try {Double.parseDouble(Question.useranser[y]); //可以轉換為整型; } catch (Exception g) {if(Question.useranser[y].equals(" ")){}else{String[] ss = new String[2];ss = Question.useranser[y].split("/");cs[0] = Integer.valueOf(ss[0]);cs[1] = Integer.valueOf(ss[1]);double answer = (double) cs[0] / (double)cs[1];Question.useranser[y]=Question.decimal.format(answer);}}if(Question.useranser[y].equalsIgnoreCase(Question.staticanser[y]))count++;}JLabel lblNewLabel = new JLabel("答對:"+String.valueOf(count)+"題");lblNewLabel.setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();gbc_lblNewLabel.fill = GridBagConstraints.HORIZONTAL;gbc_lblNewLabel.anchor = GridBagConstraints.WEST;gbc_lblNewLabel.insets = new Insets(0, 20, 5, 30);gbc_lblNewLabel.gridx = 1;gbc_lblNewLabel.gridy = 2;getContentPane().add(lblNewLabel, gbc_lblNewLabel);JLabel lblNewLabel_1 = new JLabel("答錯:"+String.valueOf(Question.n-count)+"題");lblNewLabel_1.setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints();gbc_lblNewLabel_1.fill = GridBagConstraints.HORIZONTAL;gbc_lblNewLabel_1.anchor = GridBagConstraints.WEST;gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 30);gbc_lblNewLabel_1.gridx = 2;gbc_lblNewLabel_1.gridy = 2;getContentPane().add(lblNewLabel_1, gbc_lblNewLabel_1);JLabel lblNewLabel_2 = new JLabel("正確率:"+String.valueOf(Question.decimal.format(((float) count / (float) Question.n) * 100))+"%");lblNewLabel_2.setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_lblNewLabel_2 = new GridBagConstraints();gbc_lblNewLabel_2.insets = new Insets(0, 0, 5, 5);gbc_lblNewLabel_2.fill = GridBagConstraints.HORIZONTAL;gbc_lblNewLabel_2.anchor = GridBagConstraints.WEST;gbc_lblNewLabel_2.gridx = 2;gbc_lblNewLabel_2.gridy = 1;getContentPane().add(lblNewLabel_2, gbc_lblNewLabel_2);JLabel lblNewLabel_7 = new JLabel("用戶答案:");lblNewLabel_7.setBackground(new Color(245, 255, 250));lblNewLabel_7.setFont(new Font("仿宋", Font.BOLD, 30));GridBagConstraints gbc_lblNewLabel_7 = new GridBagConstraints();gbc_lblNewLabel_7.gridwidth = 2;gbc_lblNewLabel_7.insets = new Insets(0, 0, 5, 5);gbc_lblNewLabel_7.gridx = 1;gbc_lblNewLabel_7.gridy = 3;getContentPane().add(lblNewLabel_7, gbc_lblNewLabel_7);for(int i=0;i<Question.n;i++){lable1[i] = new JLabel(Question.s[i]+Question.useranser[i]);lable1[i].setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints();gbc_lblNewLabel_3.anchor = GridBagConstraints.WEST;gbc_lblNewLabel_3.gridwidth = 2;gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5);gbc_lblNewLabel_3.gridx = 1;gbc_lblNewLabel_3.gridy = i+4;getContentPane().add(lable1[i], gbc_lblNewLabel_3);}JLabel lblNewLabel_8 = new JLabel("參考答案:");lblNewLabel_8.setBackground(new Color(245, 255, 250));lblNewLabel_8.setFont(new Font("仿宋", Font.BOLD, 30));GridBagConstraints gbc_lblNewLabel_8 = new GridBagConstraints();gbc_lblNewLabel_8.gridwidth = 2;gbc_lblNewLabel_8.insets = new Insets(0, 0, 5, 0);gbc_lblNewLabel_8.gridx = 3;gbc_lblNewLabel_8.gridy = 3;getContentPane().add(lblNewLabel_8, gbc_lblNewLabel_8);for(int i=0;i<Question.n;i++){lable[i] = new JLabel("("+(i+1)+")"+Question.staticanser[i]);lable[i].setFont(new Font("仿宋", Font.PLAIN, 20));GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints();gbc_lblNewLabel_3.anchor = GridBagConstraints.WEST;gbc_lblNewLabel_3.gridwidth = 2;gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5);gbc_lblNewLabel_3.gridx = 3;gbc_lblNewLabel_3.gridy = i+4;getContentPane().add(lable[i], gbc_lblNewLabel_3);}restart = new JButton("重新開始");restart.setBackground(new Color(255, 255, 153));GridBagConstraints gbc_btnNewButton = new GridBagConstraints();gbc_btnNewButton.anchor = GridBagConstraints.WEST;gbc_btnNewButton.insets = new Insets(0, 0, 0, 5);gbc_btnNewButton.gridx = 2;gbc_btnNewButton.gridy = 9;getContentPane().add(restart, gbc_btnNewButton);restart.addActionListener(this);quit = new JButton(" \u9000\u51FA ");quit.setBackground(new Color(255, 255, 153));GridBagConstraints gbc_btnNewButton_1 = new GridBagConstraints();gbc_btnNewButton_1.insets = new Insets(0, 0, 0, 5);gbc_btnNewButton_1.gridx = 3;gbc_btnNewButton_1.gridy = 9;getContentPane().add(quit, gbc_btnNewButton_1);quit.addActionListener(this);this.setVisible(true);}public static void main(String[] args) {to=new Total();}@Overridepublic void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubif(e.getSource()==restart){this.dispose();Menu m=new Menu(); }else if(e.getSource()==quit){System.exit(0);}}}

?

一、程序執行:

1、開始界面

?

2、提示輸入題量(對話框)

輸入1~5內的數字:會跳轉到出題的界面

? ?????????? 如果輸入1~5以外的數字:

    輸入非數字:

?

3、出題界面,根據用戶輸入的題量出題

?

4、用戶輸入答案,如果沒有做完就提交會彈出提示框要填完才能提交,輸入的答案不是數字提交也會提示

?

5、統計結果界面(答對多少題,打錯多少題,正確率,答案之類)

?

6、判斷用戶輸入的答案,用戶可以輸入分數,也可以輸入小數,并且支持四舍五入計算小數點后兩位:

?

?

?

7、換膚模式,在出題框架里點擊換膚模式會更換皮膚

?

?

?

  開發環境:Eclipse

????? 程序完成的方向:

  • 程序可以出帶括號的正整數四則運算,支持分數,除法保留兩位小數,如:(1/3+1)*2 = 2.67,特別注意:這里是2.67而非2.66,或保持分數形式:8/3
  • 可以出表達式里含有負整數(負整數最小不小于-100)的題目,且負數需要帶括號,用戶輸入的結果不用帶括號。如: 2*(-4) = -8
  • 用戶可以選擇出題的個數(最多不能超過5個題目),答題結束可以顯示用戶答錯的題目個數和答對的題目個數
  • 程序可以出單個整數階乘的題目:如:4!=24
  • 程序可以設置皮膚功能,可以改變界面的顏色即可。
  • ?

    結對同伴:

    ?

    姓名

    學號

    博客地址

    馮美欣

    201306114451

    http://www.cnblogs.com/maxx/

    林歡雯

    201306114450

    http://www.cnblogs.com/wzhz/

    ?

    ? ?正如書上說的,在結對編程里,沒有我的代碼,或你的代碼,只有我們的代碼,在這次的結對編程里面我跟我的同伴兩人在領航員,駕駛員的角色中切換工作,在編程過程中存在激烈的討論,遇到困難在網上收集資料解決難題。可以說程序里的每一個部分都是一起完成,因為我們在一起睡了幾個晚上,哈~~~

    總結:? ?????

    收獲:在這次的結對編程里面,給我很不一樣的感覺,感覺是一個小團隊的感覺,之前的編程都是自己一個人完成比較多,很少有這種感覺,在于同伴一起完成,收獲了以下幾點:

    1、無論做什么都要先理順思路,要一個什么東西,基本框架是什么,每一個界面的大概模型,還有基本功能是什么,都要先考慮好才能動手,不然會很混亂;

    2、在寫代碼的時候思路一定要清晰,就算遇到可惡的bug(八阿哥)也不能急,從錯誤的地方一條一條代碼地檢查,就很快你那個找錯錯誤的地方;

    3、發現自己界面方面的知識基礎不行,要多點掌握或者去了解一下這些類有哪些方法屬性,只有掌握好基礎才能更好更靈活地寫出更好地程序;

    ?

    感悟:

    ? ??經過這次的結對練習,感覺團隊是個好東西,他可以讓每個人看到自己不足,也能讓自己發現自身好的地方,而且在遇到關卡時不用一個人在那里抓狂,有一個人可以陪你一起激烈的討論,不斷的調試,把bug一個一個地解決掉,那種感覺真的倍爽!!

    我會發現自己需要多點了解java,多點了解怎么實現一些小功能,保留兩位,四舍五入,框架地屬性之類地,要穩扎根基。

    在弄這個結對練習這段時間真的好有沖勁,超享受的雖然弄出來的程序不是很完美,但是程序的代碼我們一起打出來的,比完美的程序更珍貴~

    ?

    工作圖可以去看我的同伴的博客:

    林歡雯:http://www.cnblogs.com/wzhz/

    轉載于:https://www.cnblogs.com/maxx/p/4408937.html

    總結

    以上是生活随笔為你收集整理的全国小学四则运算1.0的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。