PLEASE ANSWER THIS IS THE SECOND TIME I AM POSTING IT LOOK

(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT )

LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROGRAM 5 AND USE THE EXACT INT MAIN () USED IN PROGRAM 5. PLEASE USE CONCEPTS NOT TOO ADVANCED AS LAST TIME I GOT A ZERO. JUST USE CONCEPTS TILL CHAPTER 7 IN

c++ from control structures through objects 8th edition.

isbn 13: 978-0-13-376939-5.

   ASSIGNMENT 3 ( FOR REFERENCE)

Write a program to help elementary school students practice their arithmetic skills. Using a loop, the program should display an addition question (containing random numbers[1]), get the student’s answer, and then provide feedback.

This should work as follows:

After a question is displayed, the student will enter an answer. The program checks the student’s answer and provides a feedback message to the student indicating whether the answer was right or wrong. If the student’s answer was wrong, the program should repeat the same question until the student gets it right. If the student’s answer was correct, the program should generate a new question for the student after displaying an appropriate feedback message. The drill continues until the student enters -1 in response to a question.

Numbers in the questions should range from 1...100.

When the student enters -1 the program should display the following statistics before terminating:

Total number of questions asked.

Percentage of questions answered correctly.

NOTE:

Every wrong answer counts toward the percentage. For example, if the kid answers the same question incorrectly 50 times, then that counts as 50 wrong answers.

Do not provide the same feedback message every time after a question. Instead, the program should have a pool of 4 different responses for when the student answers correctly, and another pool of 4 unique responses when the student answers the question incorrectly.

Do not use nested loops in this program. The appropriate structure only requires one loop.

HINTS:

Use a good process when developing this program:

Design it before you build it. Make sure you have the logic worked out (using pseudocode) before you code all of it.

Start immediately and work on it a little every day.

Do not try to implement all of the features of this program at one time. Do a small part, get it working and test it. Only then should you add more code. When testing, it doesn’t mean that you just compile the code, it means run the program and make sure that part works before adding more code! o             When you encounter a bug, first figure out why the current version is doing what it is doing. Only then can you identify what code changes you need to make. Do not make code changes until after you have diagnosed the problem.

Note additional requirements below:

Include a “comment box” at the beginning of the program similar to the box shown below.

//=====================================================

// your name

// due date

// Programming Assignment #3

// Description: Math Drill

//=====================================================

Use good programming style in your program. Specifically, this means

Format your code following the same conventions illustrated by the examples in the book. When printed, your code should look good!

Use appropriate indentation (as illustrated in the book) to make the logic obvious.

Comment every variable declaration with a meaningful comment.

Use mnemonic variable names (i.e., names that reflect the purpose of the value the variable will contain).

Programming style is worth 40% of your score on this assignment.

ASSIGNMENT 5 ( REAL ASSIGNMENT TO WORK ON )

Programming I
Programming Assignment #5
Program Mon, Nov 7
20 points


Re-work the Math Quizzing program by incorporating functions as described below.
•   Incorporate this added requirement: when generating a new question, the program should randomly choose between a multiplication question and an addition question. For multiplication questions, the range of numbers should be 1..10. For addition questions, the range of numbers should be 1..100.
•   Your main should have the following structure:

// you’ll prototype and define these functions
int askQuestion(bool isNewQuestion, int& questionType, int& num1, int& num2);
void rightFeedback();
void wrongFeedback();
int getRandom(int min, int max);

int main()
{
...declare variables here...
bool isCorrect; // is the user’s answer correct?
srand(time(0)); // seed the random number generator

correctAns = askQuestion(true, questionType, num1, num2);
cin >> userAns;

while ( userAns != -1 )
{
   questionCount++;
   if ( userAns == correctAns )
   {
       correctCount++;
       rightFeedback();
          
       isCorrect = true;   
   }
   else  
   {
       isCorrect = false;
       wrongFeedback();
   }

   correctAns = askQuestion(isCorrect, questionType, num1, num2);  
   cin >> userAns;
}
...show statistics...
}


The functions you must implement are described below:

•   rightFeedback() – displays a congratulatory message (chooses from a pool of 4 messages)
•   wrongFeedback() – displays a ‘you got it wrong’ message (chooses from a pool of 4 messages)
•   int askQuestion(bool isNewQuestion, int& questionType, int& num1, int& num2) – Displays a question. If the first argument is true, it should generate a new question, storing new values into the questionType, num1, and num2 parameters. If the first parameter is false, it displays the old question (i.e., the question described by the current contents of questionType, num1, and num2). askQuestion always returns the correct answer to the question that was asked.
•   int getRandom(int min, int max) – returns a random number in the range min…max (inclusive). You should call this function any time you need a random number.
•   You are free to add additional functions if you wish, but you must use the functions as described above.

Note additional requirements below:

1.   If your program does not have the structure/functions described above, you will not be practicing what you need to practice. There are many possible good ways to structure this program, but I’m asking you to use the given structure. You will receive a zero on the assignment if you do not use the structure described above.
2.   Include a “comment box” at the beginning of the program similar to the box shown below.
//=====================================================
// your name
// due date
// Programming Assignment #5
// Description: Math Drill with Functions
//=====================================================

3.   Use good programming style in your program. Specifically, this means
a.   Format your code following the same conventions illustrated by the examples in the book. When dealing with conditional statements, this means a code block should be indented within {}! When printed, your code should look good.
b.   Comment every variable declaration with a meaningful comment.
c.   Use mnemonic variable names (i.e., names that reflect the purpose of the value the variable will contain).
d.   Prior to each function definition, include a comment that describes (1) the main purpose of the function (2) the meaning of the parameters (3) the meaning of the returned value (if any)
e.   Programming style is worth 40% of your score on this assignment.
f.   Handwritten comments will not be accepted.

Do not use nested loops in this program. The appropriate structure only requires one loop.

Solution

#include <string>

#include <fstream>

#include <iostream>

using namespace std;

void rightFeedback(void);

void wrongFeedback (void);

  

void rightFeedback(void)

{

    int correct;

correct= correct + 1;

    switch(rand()%4)

    {

    case 0:

        puts(\"Very good!\");

        break;

    case 1:

        puts(\"Excellent!\");

        break;

    case 2:

        puts(\"Good Job!\");

        break;

    case 3:

        puts(\"You\'re Amazing!\");

        break;

    }

}

void wrongFeedback (void)

{

    int incorrect;

    incorrect= incorrect + 1;

    switch(rand()%4)

    {

    case 0:

        puts(\"Nice Try\");

        break;

    case 1:

        puts(\"You Suck!\");

        break;

    case 2:

        puts(\"Maybe Next Time!\");

        break;

    case 3:

        puts(\"Terrible!\");

        break;

    }

}

// multiplication produces pairs of random numbers and

// prompts user for product

#include <string>

(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT ) LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROG
(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT ) LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROG
(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT ) LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROG
(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT ) LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROG
(PLEASE ANSWER , THIS IS THE SECOND TIME I AM POSTING IT ) LOOK AT ASSIGNMENT 3 AND SOLVE ASSIGNMENT 5. SOLVE EXACTLY PER THE REQUIREMENTS MENTIONED IN THE PROG

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site