Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**Structure required** main_assignment |--- my_problem1 |--- src |--- CAI1.java |--- CAI2.java |--- CAI3.java |--- CAI4.java |--- CAI5.java **Should follow** Problem 1: CAI1.java contains a solution

**Structure required** main_assignment |--- my_problem1 |--- src |--- CAI1.java |--- CAI2.java |--- CAI3.java |--- CAI4.java |--- CAI5.java

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

**Should follow**

Problem 1: CAI1.java contains a solution for Part 1

Problem 1: CAI2.java contains a solution for Part 2

Problem 1: CAI3.java contains a solution for Part 3

Problem 1: CAI4.java contains a solution for Part 4

Problem 1 (CAI5.java): The program shall generate random numbers with a SecureRandom object

Problem 1 (CAI5.java): The program shall ask the student to enter a difficulty level of 1, 2, 3, or 4

Problem 1 (CAI5.java): A difficulty level of 1 shall limit random numbers to the range of 0-9, inclusive

Problem 1 (CAI5.java): A difficulty level of 2 shall limit random numbers to the range of 0-99, inclusive

Problem 1 (CAI5.java): A difficulty level of 3 shall limit random numbers to the range of 0-999, inclusive

Problem 1 (CAI5.java): A difficulty level of 4 shall limit random numbers to the range of 0-9999, inclusive

Problem 1 (CAI5.java): The program shall ask the student to enter a problem type of 1, 2, 3, 4, or 5 with an appropriate human-readable label

Problem 1 (CAI5.java): The program shall ask the student to solve 10 different problems, as determined by the problem type

Problem 1 (CAI5.java): A problem type of 1 shall limit the program to generating only addition problems

Problem 1 (CAI5.java): A problem type of 2 shall limit the program to generating only multiplication problems

Problem 1 (CAI5.java): A problem type of 3 shall limit the program to generating only subtraction problems

Problem 1 (CAI5.java): A problem type of 4 shall limit the program to generating only division problems

Problem 1 (CAI5.java): A problem type of 5 shall result questions that are a randomly mixture of addition, multiplication, subtraction, and division problems

Problem 1 (CAI5.java): Problems shall contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty

Problem 1 (CAI5.java): The program shall display a random positive message if the student provides a correct response

Problem 1 (CAI5.java): The program shall display a random negative message if the student provides an incorrect response

Problem 1 (CAI5.java): The program shall display the student's score after the student has attempted to solve 10 problems

Problem 1 (CAI5.java): The student's score shall be the percentage of problems correctly solved

Problem 1 (CAI5.java): The program shall display the message "Please ask your teacher for extra help." if the student's score is less than 75%

Problem 1 (CAI5.java): The program shall display the message "Congratulations, you are ready to go to the next level!" if the student's score is greater than or equal to 75%

Problem 1 (CAI5.java): The program shall ask the student if they want to solve a new problem set after the score message has been displayed

Problem 1 (CAI5.java): The program shall restart when the student agrees to solve a new problem set

Problem 1 (CAI5.java): The program shall terminate when the student declines to solve another problem set

Problem 1 (CAI5.java): Create a method called "quiz" that contains the program logic

Problem 1 (CAI5.java): Create a method called "readDifficulty" that reads the difficulty level from the student

Problem 1 (CAI5.java): Create a method called "readProblemType" that reads the difficulty level from the student

Problem 1 (CAI5.java): Create a method called "generateQuestionArgument" that uses the difficulty level to generate a random number

Problem 1 (CAI5.java): Create a method called "askQuestion" that prints the problem to the screen

Problem 1 (CAI5.java): Create a method called "readResponse" that reads the answer from the student

Problem 1 (CAI5.java): Create a method called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem

Problem 1 (CAI5.java): Create a method called "displayCorrectResponse" that prints out the response when a student enters a correct answer

Problem 1 (CAI5.java): Create a method called "displayInorrectResponse" that prints out the response when a student enters an incorrect answer

Problem 1 (CAI5.java): Create a method called "displayCompletionMessage" that prints out the studen't score and appropriate score response

Problem 1 (CAI5.java): Create a main method that runs your program by calling the "quiz" method

Problem 1 consists of multiple parts. You must have one.java file for each Part: CA11.java, CAI2.java, CAI3.java, CA14.java, and CA15.java. You should finish one part and ensure that it works before moving to the next part. You will build each new part by refactoring (rewrite parts of) your code from the previous part. Grading for this problem will be primarily based on your final solution in CA15.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. If it's correct, display the message "Very good!" and terminate the program. 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 method should be used to generate the question. Requirements The program shall generate random numbers with a SecureRandom object The program shall ask the student to solve a multiplication problem A multiplication problem shall contain two numbers sampled from a uniform random distribution in the range of 0 to 9 (inclusive) The program shall display the message "Very good!" if the student provides a correct response The program shall display the message "No. Please try again." if the student provides an incorrect response The program shall terminate when a correct response is provided by the student The program shall continue to ask the student to solve the original multiplication problem until the student provides the correct answer Create a method called "quiz" that contains the program logic Create a method called "askQuestion" that prints the problem to the screen Create a method called "read Response" that reads the answer from the student Create a method called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem Create a method called "displayCorrectResponse" that prints out the response when a student enters a correct answer Create a method called "displaylnorrectResponse" that prints out the response when a student enters an incorrect answer Create a main method that runs your program by calling the "quiz" method Part 2 Modify the program from Part 1 so that various comments are displayed for each answer as follows: Possible responses to a correct answer: Very good! Excellent! Nice work! Keep up the good work! Possible responses to an incorrect answer: No. Please try again. Wrong. Try once more. Don't 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. Requirements The program shall generate random numbers with a Secure Random object The program shall ask the student to solve a multiplication problem A multiplication problem shall contain two numbers sampled from a uniform random distribution in the range of 0 to 9 (inclusive) The program shall display a random positive message if the student provides a correct response The program shall display a random negative message if the student provides an incorrect response The program shall terminate when a correct response is provided by the student The program shall continue to ask the student to solve the original multiplication problem until the student provides the correct answer Create a method called "quiz" that contains the program logic Create a function called "askQuestion" that prints the problem to the screen Create a function called "readResponse" that reads the answer from the student Create a function called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem Create a function called "displayCorrectResponse" that prints out the response when a student enters a correct answer Create a function called "displaylnorrectResponse" that prints out the response when a student enters an incorrect answer Part 1: Create a main method that runs your program by calling the "quiz" method Part 3 Modify the program from Part 2 to use your question generation method to ask the student 10 different questions. Give students only one chance at answering each question. Count the number of correct and incorrect responses typed by the student. After the program has asked 10 questions (and the student types 10 answers), your program should 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 level!", then reset the program so another student can try it. Requirements The program shall generate random numbers with a SecureRandom object The program shall ask the student to solve 10 different multiplication problems Multiplication problems shall contain two numbers sampled from a uniform random distribution in the range of O to 9 (inclusive) The program shall display a random positive message if the student provides a correct response The program shall display a random negative message if the student provides an incorrect response The program shall display the student's score after the student has attempted to solve 10 problems The student's score shall be the percentage of problems correctly solved The program shall display the message "Please ask your teacher for extra help." if the student's score is less than 75% The program shall display the message "Congratulations, you are ready to go to the next level!" if the student's score is greater than or equal to 75% The program shall ask the student if they want to solve a new problem set after the score message has been displayed The program shall restart when the student agrees to solve a new problem set The program shall terminate when the student declines to solve another problem set Create a method called "quiz" that contains the program logic Create a function called "askQuestion" that prints the problem to the screen Create a function called "readResponse" that reads the answer from the student Create a function called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem Create a function called "displayCorrectResponse" that prints out the response when a student enters a correct answer Create a function called "displayinorrectResponse" that prints out the response when a student enters an incorrect answer Create a function called "display Completion Message" that prints out the student score and appropriate score response Create a main method that runs your program by calling the "quiz" method Part 4 Modify the program from Part 3 to allow the user to enter a difficulty level. At a difficulty level of 1, the program should use only single-digit numbers in the problems; at a difficulty level of 2, numbers as large as two digits, and so on. Allow for four levels of difficulty. Requirements The program shall generate random numbers with a SecureRandom object The program shall ask the student to enter a difficulty level of 1. 2. 3. or 4 A difficulty level of 1 shall limit random numbers to the range of 0-9, inclusive A difficulty level of 2 shall limit random numbers to the range of 0-99, inclusive A difficulty level of 3 shall limit random numbers to the range of 0-999, inclusive A difficulty level of 4 shall limit random numbers to the range of 0-9999, inclusive The program shall ask the student to solve 10 different multiplication problems Multiplication problems shall contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty The program shall display a random positive message if the student provides a correct response The program shall display a random negative message if the student provides an incorrect response The program shall display the student's score after the student has attempted to solve 10 problems The student's score shall be the percentage of problems correctly solved The program shall display the message "Please ask your teacher for extra help." if the student's score is less than 75% The program shall display the message "Congratulations, you are ready to go to the next level!" if the student's score is greater than or equal to 75% The program shall ask the student if they want to solve a new problem set after the score message has been displayed The program shall restart when the student agrees to solve a new problem set The program shall terminate when the student declines to solve another problem set Create a method called "quiz" that contains the program logic Create a function called "readDifficulty" that reads the difficulty level from the student Create a function called "generate QuestionArgument" that uses the difficulty level to generate a random number Create a function called "askQuestion" that prints the problem to the screen Create a function called "readResponse" that reads the answer from the student Create a function called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem Create a function called "displayCorrectResponse" that prints out the response when a student enters a correct answer Create a function called "displaylnorrectResponse" that prints out the response when a student enters an incorrect answer Create a function called "displayCompletion Message" that prints out the studen't score and appropriate score response Create a main method that runs your program by calling the "quiz" method Part 5 Modify the program from Part 4 to allow the user to pick a type of arithmetic problem to study. An option of 1 means addition problems only, 2 means multiplication problems only, 3 means subtraction problems only, 4 means division problems only and 5 means a random mixture of all these types. Requirements The program shall generate random numbers with a Secure Random object The program shall ask the student to enter a difficulty level of 1, 2, 3, or 4 A difficulty level of 1 shall limit random numbers to the range of 0-9, inclusive A difficulty level of 2 shall limit random numbers to the range of 0-99, inclusive A difficulty level of 3 shall limit random numbers to the range of 0-999, inclusive A difficulty level of 4 shall limit random numbers to the range of 0-9999, inclusive The program shall ask the student to enter a problem type of 1, 2, 3, 4, or 5 with an appropriate human-readable label The program shall ask the student to solve 10 different problems, as determined by the problem type A problem type of 1 shall limit the program to generating only addition problems A problem type of 2 shall limit the program to generating only multiplication problems A problem type of 3 shall limit the program to generating only subtraction problems A problem type of 4 shall limit the program to generating only division problems A problem type of 5 shall result questions that are a randomly mixture of addition, multiplication, subtraction, and division problems Problems shall contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty The program shall display a random positive message if the student provides a correct response The program shall display a random negative message if the student provides an incorrect response The program shall display the student's score after the student has attempted to solve 10 problems The student's score shall be the percentage of problems correctly solved The program shall display the message "Please ask your teacher for extra help." if the student's score is less than 75% The program shall display the message "Congratulations, you are ready to go to the next level!" if the student's score is greater than or equal to 75% The program shall ask the student if they want to solve a new problem set after the score message has been displayed The program shall restart when the student agrees to solve a new problem set The program shall terminate when the student declines to solve another problem set Create a method called "quiz" that contains the program logic Create a method called "read Difficulty" that reads the difficulty level from the student Create a method called "readProblem Type" that reads the difficulty level from the student Create a method called "generate QuestionArgument" that uses the difficulty level to generate a random number Create a method called "ask Question" that prints the problem to the screen Create a method called "read Response" that reads the answer from the student Create a method called "isAsnwerCorrect" that checks to see if the student's answer matches the correct answer to the problem Create a method called "displayCorrectResponse" that prints out the response when a student enters a correct answer Create a method called "displaylnorrectResponse" that prints out the response when a student enters an incorrect answer Create a method called "displayCompletion Message" that prints out the studen't score and appropriate score response Create a main method that runs your program by calling the "quiz" method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions