Yanqi_Fan 831902104 2021-10-18 22:23 采纳率: 0%
浏览 16

EE308 LAB5

The Link Your Class https://bbs.csdn.net/forums/MUEE308FZ?category=0
The Link of Requirement of This Assignment https://bbs.csdn.net/topics/601188617
MU STU ID and FZU STU ID19105932 & 831902104
Teammate1's MU STU ID and FZU STU ID19105576 & 831902202
Teammate2's MU STU ID and FZU STU ID19105592 & 831902115
Teammate3's MU STU ID and FZU STU ID19104031 & 831902114
Teammate4's MU STU ID and FZU STU ID19103158 & 831902116
GitHub link https://github.com/1252845841hhAs/Lab05-Snowed-in-Taipei-

PSP Form

PSPPersonal Software Process StageEstimated Time (minutes)Actual Time (minutes)
PlanningMake a plan1010
EstimateEstimate how long the task will take160175
DevelopmentThe development of78
AnalysisRequirements analysis (including learning new technology)1214
Design SpecGenerate design documents66
Design ReviewDesign review34
Coding StandardCode specifications (develop appropriate specifications for current development)33
DesignSpecific design4042
CodingSpecific coding120130
Code ReviewCode review78
TestTest (self-test, modify code, commit changes)1020
ReportingReport1010
TestTest report--
Postmortem&Process ImprovementSummarize afterwards and propose process improvement plan67
Summary-160175

Learning Progress Bar

hoursnew code(line)Cumulative code (line)Important growth
0.500Analyze the experimental project, establish the general framework, the team leader to the division of labor
1150150Use if, switch, and for statements
0.52020How to generate random numbers
0.51010How to keep two decimal places
100Program result testing and modification & Blog Writing

The Division Of Responsibilities Of Team Members

Team MembersMU IDThe Division Of Responsibilities
Yue Zhuo19105592Grade 1 to grade 2: addition and subtraction of integers within 100 and github
Jinhan Lin19103158Grade 1 to grade 2: addition and subtraction of integers within 100 and github
Chuan He19104031Grades 3 to 4: addition, subtraction, multiplication and division of integers and CSDN
Yanqi Fan19105932Grades 3 to 4: addition, subtraction, multiplication and division of integers and CSDN
Yaxing Li19105576Grades 5 to 6: addition, subtraction, multiplication and division including decimals

Program Running Environment

C++


Screenshot of the Software Running

img

img

img


Event

Firstly, in the design process, we found that multiple layers of identification input and different operations are required this time, which is different from the single or single-layer input and judgment we faced before.

Secondly, since the use of random numbers is involved, we are not familiar with the call of such functions. Therefore, we have fully understood the use of Rand functions through consulting materials. At the same time, we note that random numbers can also help us generate random operators. Since Grades 3-6 need to calculate multiplication and division, we use if statements to represent "+" "-" "*" "/" by generating four numbers: 0, 1, 2 and 3. After running the program, we found that there are some small mathematical problems in the program. For example, negative numbers and divisor 0 may occur during subtraction. We also realized through the code that there will be no questions with negative answers and divisor 0.

#include <time.h>
srand(time(NULL));
int a=rand()%100;
int b=rand()%100;

Thirdly, when generating decimals, sometimes the answer is infinite decimals, and the result we need is to retain two decimal places. After the brainstorming of team members, we use the following methods to realize the operation of retaining two decimal places. We first add 0.005 to the obtained data, and this step realizes the rounding of the two decimal places after the decimal point, Then multiply the number by 100 to get an integer of type int, and then divide by 100 to get a floating-point number in the form of float, that is, the answer we need.

double a=(double)(rand())/1000;
double b=(double)(rand())/1000;
a = ((float)((int)((a+0.005)*100))/100);
b = ((float)((int)((b+0.005)*100))/100);

Finally, in order to accomplish the main function, we use the random numbers and get the results. Then, we compare the result to the answer that typed in. We divided the whole score, which is 100, by the number of questions. If the answer is true, we add the score. If wrong, we lose the score. At the end, we calculate the scores we gain, and show it on the screen.

for(size; size>0; size--) {
        int type=rand()%2;
        if(type==0) {
            int a=rand()%100;
            int b=rand()%100;
            int result;
            result=a+b;
            cout<<a;
            cout<<"+";
            cout<<b;
            cout<<"=";
            int student;
            cin>>student;
            if(student==result) {
                source=source+source1;
                i++;
            }
        }

Team Programming Experience

img

  • 写回答

1条回答 默认 最新

  • 二老孟 2022-11-04 17:15
    关注

    ....

    评论

报告相同问题?

问题事件

  • 创建了问题 10月18日

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏