Program Plan-
- The modification is in the comments being displayed for the correct answer and incorrect answer. If the answer is correct/incorrect any one of the four responses will be displayed based on random number generation from 1 to 4 using a switch case statement.
- Ask the student to enter the two numbers and validate his answer by creating a function multiply().
- Display the question repeatedly until the student gives the correct answer.
- Display the message every time to inform the student whether his/her answer is correct or incorrect.
- Call the function multiply() from the main and display the result.
The following are the modifications done-
Possible responses to the correct answer-
Very good;
Excellent;
Nice work;
Keep up the good work;
Possible responses to incorrect answer-
No, please try again
Wrong, try once more
Don’t give up
No, keep trying.
Summary Introduction- The program instructs and elementary school student to learn the multiplication.
Program Description- The purpose of the program is to give the instruction to an elementary school student such that he/she can learn the multiplication. The program uses the function multiply(int, int) which takes two integers and multiplies them, the student tells the answer, if the answer matches, it displays the answer is correct otherwise instructs the student to try again.
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
MYPROGRAMMINGLAB WITH PEARSON ETEXT
- To what extent does experience help in spotting and escaping an endless loop in code?arrow_forwardPython Jupyter Notebookarrow_forwardc# Good day, i am suppose to ask the user for a number i have it assigned to Num1 and then do a simple division calculation, my problem is that when i do the last output for the user it is being read as 0 and i do know i assigned x as zero, but how do i do it so its what the user input? here is some of my work so far : using System; namespace ClassSubmissionAssignment{class Program{static void Main(string[] args){ Console.WriteLine("Hiya, Please enter a number: ");string num1 = Console.ReadLine();int Num1 = Convert.ToInt32(num1); int Num2; //Num2 is an integer datatypeint total1;//total1 is an integer datatype Operations OpObj = new Operations();//instantiating the class OpObj.methodOne(out Num1, out Num2, out total1);Console.WriteLine("Number we will be dividing by " + Num2);Console.WriteLine("The total of" + Num1 + "/" + Num2+ "=" + total1);}}} using System;namespace ClassSubmissionAssignment{public class Operations{public void methodOne(out int x, out int y, out int total){ x =…arrow_forward
- please code in python You place a pawn at the top left corner of an n-by-n chess board, labeled (0,0). For each move, you have a choice: move the pawn down a single space, or move the pawn down one space and right one space. That is, if the pawn is at position (i,j), you can move the pawn to (i+1,j) or (i+1, j+1). Ask the user for the size of a chessboard, n (integer). Find the number of different paths starting from (0,0) that the pawn could take to reach each position on the chess board. For example, there are two different paths the pawn can take to reach (2,1). Look at the diagrams below to convince yourself of this. You can see the four paths that you can take by move 2. Start -> Move 1 -> Move 2 (0,0) -> (1,0) -> (2,1) (0,0) -> (1,0) -> (2,0) (0,0) -> (1,1) -> (2,1) (0,0) -> (1,1) -> (2,2) Print the board with the number of ways to reach each square labeled as shown below. For example: Enter a board size: 4 1 0 0 0 1 1 0 0 1 2 1 0 1 3 3 1arrow_forward[Python Language] Using loops of any kind, lists, or Sets is not allowed. Sloan’s Book Collection Sloan loves reading books. She recently started reading an AI generated series called “Harry Trotter”. Sloan is collecting books from the series at her nearest bookstore. Since the series is AI generated, the publishers have produced an infinite collection of the books where each book is identified by a unique integer. The bookstore has exactly one copy of each book. Sloan wants to buy the books in the range [l,r], where l ≤ r. As an example, the range [−3,3] means that Sloan wants to buy the books − 3, − 2, − 1, 0, 1, 2, and 3. Pam also loves the series (or maybe annoying Sloan– who knows, really), and he manages to sneak into the bookstore very early to buy all of the books in the range [d,u], where d ≤ u. When Sloan later visits, sadly she will not find those books there anymore. For example, if Sloan tries to buy books [−2,3] and Pam has bought books [0,2], Sloan would only receive…arrow_forwardPython task: Task OverviewYour task is to implement a variation of the classic word game Hangman, which involves playersguessing the letters in a word chosen at random with a finite number of guesses. While there arealternate versions such as category Hangman and Wheel of Fortune, which involve playersguessing idioms, places, names and so on, we will be sticking with the traditional version.If you are unfamiliar with the rules of the game, please read the following before starting:http://en.wikipedia.org/wiki/Hangman_(game). You can also play an online version here. Don’tbe intimidated - You’ll be given some skeleton code to get you started, it's easier than it looks! You will implement a function called main that allows users to play an interactive hangman gameagainst the computer. The computer should pick a word, and players should then try to guess lettersin the word until they win or run out of guesses.Here is the overarching behaviour we expect:1. The program should load a list of…arrow_forward
- flow chart and dimple program. Python thank youarrow_forward4) Roll the dice 2 Make a program that tests the probability of a certain score when rolling x dice. The user should be able to choose to roll eg 4 dice and test the probability of a selected score eg 11. The program should then do a number of simulations and answer how big the probability is for the selected score with as many dice selected. There must be error checks so that you cannot enter incorrect sums, for example, it is not possible to get the sum 3 if you roll 4 dice. TarningsKast2 How many dices do you want to throw? 11 Which number do you want the probability for? The probability the get the number 11 with 4 dices is 7.19% Calculatearrow_forwardPlease color the code? Identifier (RED) Expression(BLUE) Statement(Yellow) Reserved words(dark red) Please helparrow_forward
- Alert dont submit AI generated answer.arrow_forwardIntroductory: The Caesar Cipher technique is one of the earliest and simplest methods of encryption techniques. It is simply a type of substitution cipher, i.e., each letter of a given text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. The method is apparently named after Julius Caesar, who apparently used it to communicate with his officials. Thus, to cipher a given text we need an integer value, known as a shift which indicates the number of positions each letter of the text has been moved down. The encryption can be represented using modular arithmetic by first transforming the letters into numbers, according to the scheme, A = 0, B = 1 ,…, Z = 25. Encryption of a letter by a shift n can be described mathematically as. En(x) = (x+n) mod 26 (Encryption Phase with shift n) Write an algorithm and implement a program in C to read the data from a file (called…arrow_forwardanswer questions ( java language ) let: a= 2 b = 4 c= 5 d= 2 e= 20 f= 50arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning