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 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 a question such as: How much is 8 * 9? The student then types the answer. Your program checks the student’s answer. If it is correct, print “Very good!” and then ask another addition question. If the answer is wrong, print “No. Please try again.” and then let the student try the same question again repeatedly until the student finally gets it right. Terminate the program when the student has 5 right answers.) 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.

I am programming student so please keep code simple enough that I can learn from it thanks

Solutions

Expert Solution


import java.util.Scanner;    //importing Scanner class
import java.util.Random;     //importing random class. to generate random numbers

class primary{
    public static void main(String...args){
        Scanner input=new Scanner(System.in);    //create object for Scanner class
        Random randomnumber = new Random();      //create object for random class
        int right_answercount=0;                  //number of correct answers count
        int wrong_answercount=0;                  //number of wrong answers count
        int total_questions=0;                   // total number of questions
        int percentage;                          // this variable is used for storing percentage..
     
        while(right_answercount<5){             //it execute loop until 5 right answers
          
        int num1=randomnumber.nextInt(10);       //taking random number and assign to num1 variable
        int num2=randomnumber.nextInt(10);       //taking random number and assign to num2 variable
        System.out.println("how much"+num1+"*"+num2+"?");     //asaking question
        int useranswer=input.nextInt();           //taking answer from user
        int total=num1*num2;                      //calculating correct answer
        if(total==useranswer){                     //if user answer is correct if block execute
            right_answercount=right_answercount+1; //increament right_answer
            System.out.println("very good");}    
          
         else if(total!=useranswer){                //if user answer is wrong.else if block execute
            wrong_answercount=wrong_answercount+1; //increament wrong_answers
            System.out.println("No. Please try again.");}
          
        total_questions=total_questions+1;          //increamenting toatal+questions
      
        }
    System.out.println("Total number of questions you attemted are : "+total_questions); //printing total no.of questions attempted
    System.out.println("correct answers are: "+right_answercount);      // printing total no.of questions are correct        
     System.out.println("Wrong answers are: "+wrong_answercount);        // printing total no.of questions are wrong
   
    percentage=(100*right_answercount)/total_questions;              //calculating percentage
  
    if(percentage<75){                                             //if percentage is <75.if block execute
    System.out.println("Please ask for extra help..");}
  
    else if(percentage>=75){                                         //if percentage is >=75.else if block execute
    System.out.println("Good work!");}
  
    }}
       


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 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...
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