// C++ program to design an application for kids to learn addition, subtraction and multiplication for numbers from 1 to 10.
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <iomanip>
using namespace std;
int main() {
srand(time(NULL));
int correct_ans, total_ques=1, operation_type,num1, num2, num_correct=0;
char choice, operation, correct_option, user_option;
int choice1,choice2,choice3,choice4, correct_choice;
int lower_bound, upper_bound;
cout<<"Welcome to Smart Arithmetic"<<endl;
// loop that continues till the user wants
do{
operation_type = rand()%3; // randomly generate the type of operation
switch(operation_type)
{
case 0:
operation = '+';
break;
case 1:
operation = '-';
break;
case 2:
operation = '*';
break;
}
// randomly generate the operands between [1,10]
num1 = rand()%10 + 1;
if(operation == '-')
if(num1 == 1)
num2 = 1;
else
num2 = rand()%num1 + 1;
else
num2 = rand()%10 + 1;
if(operation == '+')
correct_ans = num1 + num2;
else if(operation == '-')
correct_ans = num1 - num2;
else
correct_ans = num1*num2;
// generate the bounds for the choices
lower_bound = correct_ans - 30;
upper_bound = correct_ans + 30;
if (lower_bound <= 0)
lower_bound = 1;
if(upper_bound > 100)
upper_bound = 100;
// randomly generate the choices
choice1 = rand()%(upper_bound-lower_bound+1) + lower_bound;
while(choice1 == correct_ans)
choice1 = rand()%(upper_bound-lower_bound+1) + lower_bound;
choice2 = rand()%(upper_bound-lower_bound+1) + lower_bound;
while(choice2 == choice1 || choice2 == correct_ans)
choice2 = rand()%(upper_bound-lower_bound+1) + lower_bound;
choice3 = rand()%(upper_bound-lower_bound+1) + lower_bound;
while((choice3 == choice2) || (choice3 == choice1) || (choice3 == correct_ans))
choice3 = rand()%(upper_bound-lower_bound+1) + lower_bound;
// randomly generate the position of correct answer
correct_choice = rand()%4;
if(correct_choice == 0)
{
correct_option = 'a';
choice4 = choice1;
choice1 = correct_ans;
}else if(correct_choice == 1)
{
correct_option = 'b';
choice4 = choice2;
choice2 = correct_ans;
}else if(correct_choice == 2)
{
correct_option = 'c';
choice4 = choice3;
choice3 = correct_ans;
}else
{
correct_option = 'd';
choice4 = correct_ans;
}
// display the question and input the answer from user
cout<<"\nQuestion "<<total_ques<<" : "<<num1<<" "<<operation<<" "<<num2<<endl;
cout<<"a) "<<choice1<<" b) "<<choice2<<" c) "<<choice3<<" d) "<<choice4<<endl;
cout<<"Your answer (a/b/c/d): ";
cin>>user_option;
// check the user response
if(tolower(user_option) == correct_option)
{
num_correct++;
cout<<"Correct. Congratulations!"<<endl;
}else
{
cout<<"Wrong answer. Correct ans is "<<correct_option<<" : "<<correct_ans<<endl;
}
cout<<"\nWould you like to continue (y/n): ";
cin>>choice;
if(tolower(choice) == 'y')
total_ques++;
}while(tolower(choice) == 'y');
// calculate the percentage of user
float percent = (((float)(num_correct*100))/total_ques);
// print the summary
cout<<"\nTotal number of questions : "<<total_ques<<endl;
cout<<"Total correct answers : "<<num_correct<<endl;
cout<<"Percentage of correct answers : "<<fixed<<setprecision(2)<<percent<<endl;
if(percent >= 80)
cout<<"Excellent Work!"<<endl;
else if(percent >=60)
cout<<"Good Work. You can do better"<<endl;
else
cout<<"You need practice"<<endl;
return 0;
}
//end of program
Output:
You are asked to prepare a software for kids to learn addition, subtraction and multiplication for...
First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....