java课程设计-算术运算测试

1. 团队名称、团队成员介绍

团队名称:cococo

团队成员

组长:网络1514叶城龙 201521123109
组员:网络1514余腾鑫 201521123108

2. 项目git地址

http://git.oschina.net/imxx/java201521123108/tree/master

https://git.oschina.net/yycl/java109

3. 项目git提交记录截图(要体现出每个人的提交记录、提交说明),老师将点击进去重点考核。

1109881-20170622143648054-1379273507.png

1109881-20170622143601241-1552369629.png
其中第一张图里大多是相关于随机算式生成以及答案比较的方程的提交记录,第二张图大多是关于排行榜的。

4. 项目功能架构图与主要功能流程图

1109881-20170622151532476-541277971.png

5. 项目运行截图

1109881-20170622151559710-1436102715.png

1109881-20170622151613741-1839545733.png

1109881-20170622151623429-1459829481.png

6.项目关键代码(不能太多)

生成随机运算的主要算法代码

1109881-20170622154417882-1909825112.png

比较答案的主要算法代码

1109881-20170622152313663-207588759.png

排行榜模块代码

1109881-20170622154438366-355949685.png

1109881-20170622154510226-652892725.png

1109881-20170622154524038-1454486206.png

7.尚待改进或者新的想法

增大排行榜的容量,并且引入查看更多。

8. 团队成员任务分配,团队成员课程设计博客链接,标明组长。

叶城龙(组长):编写排行榜代码,玩家信息的储存,排行榜界面设计。个人博客链接:http://www.cnblogs.com/yycl/p/7065520.html

余腾鑫(组员):算术运算的设计及相关代码,编写主界面,团队博客编写。个人博客链接:http://www.cnblogs.com/yytx/p/7065317.html

转载于:https://www.cnblogs.com/yytx/p/7064790.html

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个Java小学算术运算测试程序的示例: ```java import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; public class ArithmeticTestProgram extends Frame implements ActionListener { private Label label1, label2, label3, label4, label5, label6, label7, label8, label9, label10; private TextField textField; private Button button; private ArrayList<String> questions; private ArrayList<String> answers; public ArithmeticTestProgram() { setTitle("小学生四则运算测试系统-郑州轻工业大学-***-开发,****..");//设置标题 setLayout(new GridLayout(12, 1)); label1 = new Label("小学生四则运算测试系统"); label2 = new Label("请输入题目数量:"); textField = new TextField(); button = new Button("开始测试"); button.addActionListener(this); add(label1); add(label2); add(textField); add(button); setSize(400, 300); setVisible(true); } public void actionPerformed(ActionEvent e) { if (e.getSource() == button) { int num = Integer.parseInt(textField.getText()); generateQuestions(num); saveQuestionsToFile(); } } private void generateQuestions(int num) { questions = new ArrayList<>(); answers = new ArrayList<>(); for (int i = 0; i < num; i++) { int operand1 = (int) (Math.random() * 100); int operand2 = (int) (Math.random() * 100); int operator = (int) (Math.random() * 4); String question = ""; String answer = ""; switch (operator) { case 0: question = operand1 + " + " + operand2 + " = "; answer = String.valueOf(operand1 + operand2); break; case 1: question = operand1 + " - " + operand2 + " = "; answer = String.valueOf(operand1 - operand2); break; case 2: question = operand1 + " * " + operand2 + " = "; answer = String.valueOf(operand1 * operand2); break; case 3: question = operand1 + " / " + operand2 + " = "; answer = String.valueOf(operand1 / operand2); break; } questions.add(question); answers.add(answer); } } private void saveQuestionsToFile() { File file = new File("questions.txt"); try { FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos); for (int i = 0; i < questions.size(); i++) { String question = questions.get(i); String answer = answers.get(i); String line = question + answer + "\n"; bos.write(line.getBytes()); } bos.close(); fos.close(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { ArithmeticTestProgram program = new ArithmeticTestProgram(); } } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值