Question

In: Computer Science

The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI...

The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI systems monitor the student’s performance over a period of time. The decision to begin a new topic is often based on the student’s success with previous topics. Modify the c++ program which I included to count the number of correct and incorrect responses typed by the student. After the student types 5 answers, your program should calculate the percentage of correct responses. If the percentage is lower than 75 percent, your program should print “Please ask for extra help” and then terminate. If the percentage is 75 percent or higher, your program should print “Good work!” and then terminate.

#include<bits/stdc++.h> //headerfile
using namespace std;
int main(){
int cont=0;
while(cont<5){ //we will come out of loop when we get 5 correct answers
// This program will create different sequence of
// random numbers on every program run because of srand
   srand(time(0));
int x=rand()%10; //we took modulo 10 because all numbers should be between 0 to 9
int y=rand()%10;
cout<<"How much is "<<x<<"*"<<y<<"?"<<endl;
  
int out;
int res=x*y;//actual output
cin>>out; //we enter the result as output
if(res==out){ //if actual output matches our solution
   cout<<"Very good!"<<endl;
cont++;
}else{ //if actual output doesn't match our solution
while(res!=out){ //we will repeatedly ask the user same question till we get answer
   cout<<"No. Please try again."<<endl;
cout<<"How much is "<<x<<"*"<<y<<"?"<<endl;
cin>>out;
}
cont++;
}   
}
}

Solutions

Expert Solution

#include<bits/stdc++.h> //headerfile
using namespace std;
int main(){
   int cont=0;
   int incorrect = 0,correct = 0; // to count correct and incorrect
   while(cont<5){ //we will come out of loop when we get 5 correct answers
       // This program will create different sequence of
       // random numbers on every program run because of srand
       srand(time(0));
       int x=rand()%10; //we took modulo 10 because all numbers should be between 0 to 9
       int y=rand()%10;
       cout<<"How much is "<<x<<"*"<<y<<"?"<<endl;
       int out;
       int res=x*y;//actual output
       cin>>out; //we enter the result as output
       if(res==out){ //if actual output matches our solution
           cout<<"correct"<<endl;;
           correct++;
       }else{
           cout<<"wrong"<<endl;
           incorrect++;
       }   
       cont++;   
   }
   double percent = ((double)correct/(correct+incorrect))*100; // check correct %
   if(percent>=75){
       cout <<"Good work!";
   }else{
       cout<<"Please ask for extra help";
   }
}

/* OUTPUT */

/* PLEASE UPVOTE */


Related Solutions

The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI...
The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI systems monitor the student’s performance over a period of time. The decision to begin a new topic is often based on the student’s success with previous topics. Modify the following auxiliary program (Computers are playing an increasing role in education. Write a program that will help an elementary school student learn multiplication. Use rand to produce two positive one-digit integers. It should then type...
6.35 (Computer-Assisted Instruction) The use of computers in education is referred to as computer-assisted instruction (CAI)....
6.35 (Computer-Assisted Instruction) The use of computers in education is referred to as computer-assisted instruction (CAI). 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 user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another...
USE C language :- The use of computers in education is referred to as computer-assisted instruction...
USE C language :- The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use the rand function to produce two positive one-digit integers. The program should then 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 student’s answer. If it’s correct, display the message "Very good!" and ask...
IN JAVA Part 1 The use of computers in education is referred to as computer-assisted instruction...
IN JAVA Part 1 The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then 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 student’s answer....
Do you believe that nursing and medical education needs more formal instruction of alternative therapies in...
Do you believe that nursing and medical education needs more formal instruction of alternative therapies in current educational curriculums? Why or why not? Should there be continuing education requirements related to alternative therapies? Why or why not?
In a computer instruction format, the instruction length is 11 bits and the size of an...
In a computer instruction format, the instruction length is 11 bits and the size of an address field is 4 bits. Is it possible to have 5 two-address instructions 45 one-address instructions 32 zero-address instructions using the specified format? Justify your answer.
In a computer instruction format, the instruction length is 12 bits and the size of an...
In a computer instruction format, the instruction length is 12 bits and the size of an address field is 5 bits. The system architect has already designed three 2-address instructions and thirty one 1-address instructions. How many 0-address instructions can still be possibly accommodated?
In a computer instruction format, the instruction length is 16 bits and the size of an...
In a computer instruction format, the instruction length is 16 bits and the size of an address field is 4 bits. Is it possible to have: 15 instructions with 3 addresses, 14 instructions with 2 addresses, 31 instructions with one address, and 16 instructions with zero addresses, using this format? Justify your answer.
Franklin Training Services (FTS) provides instruction on the use of computer software for the employees of...
Franklin Training Services (FTS) provides instruction on the use of computer software for the employees of its corporate clients. It offers courses in the clients’ offices on the clients’ equipment. The only major expense FTS incurs is instructor salaries; it pays instructors $5,300 per course taught. FTS recently agreed to offer a course of instruction to the employees of Novak Incorporated at a price of $490 per student. Novak estimated that 20 students would attend the course. Base your answers...
Franklin Training Services (FTS) provides instruction on the use of computer software for the employees of...
Franklin Training Services (FTS) provides instruction on the use of computer software for the employees of its corporate clients. It offers courses in the clients’ offices on the clients’ equipment. The only major expense FTS incurs is instructor salaries; it pays instructors $5,300 per course taught. FTS recently agreed to offer a course of instruction to the employees of Novak Incorporated at a price of $490 per student. Novak estimated that 20 students would attend the course. Base your answers...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT