Question
Please put the outputs with it also I want to make sure it runs thanks
Project-Computer-Assisted Instruction (50 points) use of computers in education is referred to as computer-assisted instruction (CAl) should then Writ e a program that will help an elementary school student learn multiplication. Use the rand function to produce two positive one-digit integers. The program prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the students answer its correct, display the message Very good! and ask another multiplication question.If the answer is wrong, display the message No. Please try again. and let the student try the same question repeatedly until the student finally gets it right. A separate function should be used to generate each new question. This function should be called once when the application begins execution and each time the user answers the question correctly. One problem in CAl environments is student fatigue. This can be reduced by varying the computers responses to hold the students attention. Modify the program of part a so that various comments are displayed for each answer as follows: Possible responses to a correct answer: If b) Very good Excellent! Nice work! Keep up the good work! Possible responses to an incorrect answer: No. Please try again. Wrong. Try once more. Dont give up! No. Keep trying. Use random-number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch statement to issue the responses. Use two functions: one for responses toa correct answer and another for responses to an incorrect answer More sophisticated computer-assisted instruction systems monitor the students performance over a period of time. The decision to begin a new topic is often based on the students success with previous topics. Modify the program of part b to count the number of correct and incorrect responses typed by the student. After the student types 10 answers, your program should use a function to calculate the percentage that are correct. If the percentage is lower than 75%, display Please ask your teacher for extra help., then reset the program so another student can try it. If the percentage is 75% or higher, display Congratulations, you are ready to go to the next levell, then reset the c) program so another student can try it. d) Part c developed a computer-assisted instruction program to help teach an elementary school student multiplication. Modify the function you create in part a to allow the
media%2F1c5%2F1c51ea32-20d9-4958-b87a-75
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the program in C. Let me know in the comment if you need help understanding the problem or if you face any errors.

Program

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int rightAnswers = 0;
int wrongAnswers = 0;

int getNumber(int difficultyLevel)
{
// we don't want to generate number 0. ( in case of divisions)
// hence this check.
int number = 0;
do
{
number = rand() % (int)pow(10, difficultyLevel);
}while(number == 0);
return number;
}

int getRandomNumberBetweenRange(int start, int end)
{
return (rand() % (end - start + 1)) + start;
}

void printCorrectAnswer()
{
const static char message[][40] = {"Very good!", "Excellent!", "Nice Work!", "Keep the good work!"};
int messageIndex = getRandomNumberBetweenRange(0,3);
printf("%s", message[messageIndex]);
rightAnswers++;
}

void printWrongAnswer()
{
const static char message[][40] = {"No. Please try again.", "Wrong. Try once more.", "Don't give up!", "No. Keep trying"};
int messageIndex = getRandomNumberBetweenRange(0,3);
printf("%s", message[messageIndex]);
wrongAnswers++;
}

// PRE:
// questionType between 1 to 5.
// difficultyLevel between 1 to 3.
void getQuestion(int questionType, int difficultyLevel)
{
int firstNumber = getNumber(difficultyLevel);
int secondNumber = getNumber(difficultyLevel);
  
if(questionType == 5) questionType = getRandomNumberBetweenRange(1,4);
  
char op = ' ';
do
{
switch(questionType)
{
case 1: op = '+'; break;
case 2: op = '-'; break;
case 3: op = '*'; break;
case 4: op = '/'; break;
}
  
printf("\nHow much is %d %c %d? ", firstNumber, op, secondNumber);
double studentAnswer = 0, answer = 0;
scanf("%lf", &studentAnswer);
  
switch(questionType)
{
case 1: answer = firstNumber + secondNumber; break;
case 2: answer = firstNumber - secondNumber; break;
case 3: answer = firstNumber * secondNumber; break;
case 4: answer = (double)firstNumber / secondNumber; break;
}
  
if(questionType == 4)
{
if(abs(answer-studentAnswer) < 0.01)
{
printCorrectAnswer();
break;
}
else
{
printWrongAnswer();
}
}
else
{
if(studentAnswer == answer)
{
printCorrectAnswer();
break;
}
else
{
printWrongAnswer();
}
}
}while(1);
}


int main()
{
int questionsCount = 0;
  
do
{
printf("\n1. Addition problems\n2. Subtraction problems \n3. Multiplication problems\n4. Division problems\n5. Mixed\n6. Terminate");
  
int problemType = 0;
do
{
printf("\nPick your problem (1 to 5) or 6 to terminate: ");
scanf("%d", &problemType);
  
if(problemType == 6) return 0; // terminate the program.
  
if(problemType < 1 && problemType > 5)
{
printf("That's an invalid input.");
}
else break;
}while(1);
  
  
int difficultyLevel = 0;
do
{
// lets limit to 3 levels.
printf("\nEnter difficulty level (1 to 3): ");
scanf("%d", &difficultyLevel);
if(difficultyLevel < 1 && difficultyLevel > 3)
{
printf("That's an invalid input.");
}
else break;
}while(1);
  
  
while(questionsCount < 10)
{
getQuestion(problemType, difficultyLevel);
questionsCount++;
}
  
int totalAnswers = rightAnswers + wrongAnswers;
if((float)rightAnswers / totalAnswers < 0.75)
{
printf("\nPlease ask your teacher for extra help.");
}
else
{
printf("\nCongratulations you are ready to go to the next level");
}
questionsCount = 0;
rightAnswers = 0;
wrongAnswers = 0;
}while(1);
  
return 0;
}

Sample output:

1. Addition problems 2. Subtraction problems 3. Multiplication problems 4. Division problems 5. Mixed 6. Terminate Pick your problem (1 to 5) or 6 to terminate: 5 Enter difficulty level (1 to 3): 1 How much is 3 - 6? -3 Keep the good work! How much is 3 5? 15 Very good! How much is 91? 9 Keep the good work! How much is 9 * 3? 27 Very good! How much is 62? 8 Keep the good work! How much is 8 7? 1 Nice Work! How much is 2 / 3? θ.67 Keep the good work! How much is 92? 18 Nice Work! How much is 9 7? 2 Very good!

Add a comment
Know the answer?
Add Answer to:
Please put the outputs with it also I want to make sure it runs thanks Project-Computer-Assisted...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Android / Java / Please Upload your homework. Copy the screenshot and then paste it to...

    Android / Java / Please Upload your homework. Copy the screenshot and then paste it to this word document. Then zip your word file and java files. Note: if your android project is too big, you can just zip all of the needed xml files and java files. Computer-Assisted Instruction App) Create an app that will help an elementary school student learn multiplication. Select two positive one-digit integers. The app should then prompt the user with a question, such as...

  • Problem (Computer Assisted Instruction) The use of computers in education is referred to as Computer Assisted...

    Problem (Computer Assisted Instruction) The use of computers in education is referred to as Computer Assisted Instruction (CAI). Develop a Java application that can help an elementary school student learn division of two decimal integer numbers. When the application is launched, its behaviour should be like as described: 1. The application should welcome the learner and ask if ready to learn the topic. Assume the application can assist only to learn division of two integer numbers. 2. If the user...

  • Programming in C: Write a program that will help an elementary school student learn multiplication. Use...

    Programming in C: Write a program that will help an elementary school student learn multiplication. Use the random number generator to produce two positive integers between 1 and 12 inclusive. It should then type a question such as:             How much is 6 times 7? The student then types the answer. Your program checks the students’ answer. If it is correct, print a message such as Very good!   If the answer is wrong, print a message such as No. Please...

  • Write a JAVASCRIPT program that will help an elementary school student learn multiplication. Use the Random...

    Write a JAVASCRIPT program that will help an elementary school student learn multiplication. Use the Random method to produce two positive one-digit integers. The program should then prompt the user with a question using random numbers, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it is correct, display the message "Very good!" and ask whether the student wants to continue if so then ask another multiplication...

  • So I can not get this to work properly and he does not want us using...

    So I can not get this to work properly and he does not want us using an array list. Below is the directions along with the code I have(Im not sure the code is in the right format)   ITSE 2321 – OBJECT-ORIENTED PROGRAMMING JAVA Program 7 – Methods: A Deeper Look Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers. The program should then prompt the student...

  • Java Programming Write a program that will help a student learn multiplication. Use SecureRandom object to...

    Java Programming Write a program that will help a student learn multiplication. Use SecureRandom object to produce two positive integers between 1 and 20. The program should then prompt the user with a question (use a sentinel-controlled loop), such as: How much is 10 times 11? The student then inputs the answer. If the answer is correct display the message “very good” and ask another question. If the answer is wrong to display the message “no, please try again” and...

  • Write a program that will help a student learn multiplication. Use SecureRandom object to produce two...

    Write a program that will help a student learn multiplication. Use SecureRandom object to produce two positive integers between 1 and 20. The program should then prompt the user with a question (use a sentinel-controlled loop), such as: How much is 10 times 11? The student then inputs the answer. If the answer is correct display the message “very good” and ask another question. If the answer is wrong to display the message “no, please try again” and let the...

  • Need urgently.Plz use math.random() formula for random numbers and show the output as recquired. Problem (Computer...

    Need urgently.Plz use math.random() formula for random numbers and show the output as recquired. Problem (Computer Assisted Instruction) The use of computers in education is referred to as Computer Assisted Instruction (CAI). Develop a Java application that can help an elementary school student learn division of two decimal integer numbers. When the application is launched, its behaviour should be like as described: 1. The application should welcome the learner and ask if ready to learn the topic. Assume the application...

  • Instructions Basically, you will modify the mathq program to make it satisfy a different set of...

    Instructions Basically, you will modify the mathq program to make it satisfy a different set of requirements, and fix what is not working in it. Specifically, imagine that the client for whom we created the mathq program for would now like some changes. To be exact: Part 1: They want it to provide addition and subtraction problems as well as multiplication and division. They still want the choice to be random, as before, but now the problem is randomly multiplication,...

  • Python Object oriented programming Exercise 3 Dictionary Computers are playing an increasing role in education. Write...

    Python Object oriented programming Exercise 3 Dictionary Computers are playing an increasing role in education. Write a program that will help an elementary school student to learn English. To simplify the model, the program will first teach numbers from 1 to 10, colors and fruits. It will use a dictionary to store the pairs Spanish-English words. dataTable-uno':one,'dos':'two....' rojo':'red','blue':'Azul... manzana': apple, nara nja:orange. When running your program, it should get a random Spanish word from the dictionary dataTable and then show...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT