计算机与软件工程 作业二

作业要求

第二周作业

作业1

软件开发流程:软件工程包括了开发,运营, 维护软件的过程中有很多技术, 做法, 习惯, 和思想。软件工程把这些相关的技术和过程统一到一个体系中。
软件开发流程的目的:提高软件开发, 运营, 维护的效率,以及用户满意度, 可靠性,和软件的可维护性。
软件开发的工作量和质量怎么衡量
a)项目/任务有多大?
b)花了多少时间?
c)质量如何?
d)是否按时交付?

个人程序

要求
分别能够实现小学一、二、三、四、五年级的四则运算要求, 逐步实现各个年级的难度
要求能够通过输入来选择不同年级,每个年级还得区分难,中,易三个等级
对于三、四、五年级需要支持括号与多个运算符
程序支持判断对错及累计得分与时间
一次可以出100道题目,而且不能重复(比如2+3 与 3+2 算重复的)
充分发挥想象增加满足小学生数学检测需要的功能

运行结果


代码

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
void yunsuan()
{
int x=0, y=0, n=0, d;
int z;

int daan[100];
int score = 0;
srand(time(NULL));
cout << "需要多少计算式?" << endl;
cin >> n;
for (int i = 0; i < n; i++)
{
z = rand() % 4;
x = rand() % 10;
y = rand() % 10;
switch (z)
{

case 0:
cout << i + 1 << "," << x << "+" << y << "="<<endl;
daan[i] = x + y;
break;
case 1:
cout << i + 1 << "," << x << "-" << y << "=" << endl;
daan[i] = x - y;
break;
case 2:
cout << i + 1 << "," << x << "*" << y << "=" << endl;
daan[i] = x *y;
break;
case 3:
if (y != 0)
{
cout << i + 1 << "," << x << "/" << y << "=" << endl;
daan[i] = x / y;
}
else
{
i = i - 1;
}

break;
if ((i + 1) == n)
{
cout << endl;
}
}
}
for (int i = 0; i < n; i++)
{
cout << "请输入答案:" << endl;
cin >> d;
if (d == daan[i])
{
cout << "回答正确" << endl;
cout << endl;
score = score + 1;
}
}

cout << "分数为:" << score <<endl;
}
int main()
{
yunsuan();
int k;
cout << "是否继续答题?(1:继续,0:退出)" << endl;
cin >> k ;
if (k == 1)
{
cout << endl;
main();
}
else {
cout << endl;
return 0;

}
return 0;
}

未解决问题

程序没能按年级划分问题,也没有运用括号和多个运算符。

作业二

gitee链接:https://gitee.com/zhou_ying_dan/learngit

原文地址:https://www.cnblogs.com/zhou1231/p/12402349.html