Fill This Form To Receive Instant Help
Homework answers / question archive / I need help adding easy, medium, and difficult options to each of the mathematical equations to allow an option for each of the four options
I need help adding easy, medium, and difficult options to each of the mathematical equations to allow an option for each of the four options. I also need to add a data base for how many correct and incorrect responses a user gets right or wrong. Do i add that into each separate equation?
#include <stdio.h>
#include <stdlib.h>
void Addition() {
int answer;
printf("36 + 12 = ?");
scanf_s(" %d", &answer);
if (answer == 48)
{
printf("nYou are correct");
}
else
{
printf("nIncorrect");
}
}
void Subtraction() {
int answer;
printf("8 - 4 = ?");
scanf_s(" %d", &answer);
if (answer == 4)
{
printf("nYou are correct");
}
else
{
printf("nIncorrect");
}
}
void Multiplication() {
int answer;
printf("4 * 4 = ?");
scanf_s(" %d", &answer);
if (answer == 16)
{
printf("nYou are correct");
}
else
{
printf("nIncorrect");
}
}
void Division() {
int answer;
printf("4 / 14 = ?");
scanf_s(" %d", &answer);
if (answer == 0)
{
printf("nYou are correct");
}
else
{
printf("nIncorrect");
}
}
void menu() {
printf("nMath Practice Menunn");
printf("1.Additionn2.Subtractionn3.Multiplicationn4.Divisionn5.Exit.");
printf("nSelect an option:");
}
void main()
{
int answer;
int option;
menu();
scanf_s("%d", &option);
while (option)
{
switch (option)
{
case 1:
Addition();
break;
case 2:
Subtraction();
break;
case 3:
Multiplication();
break;
case 4:
Division();
break;
case 5:
printf("Thank you, goodbyen");
exit(0);
break;
}
menu();
scanf_s("%d", &option);
}
return;
}