Question: Write a program to do the following in c++: Ask the user for a beginning number between 1 and 100. If they enter a number

Write a program to do the following in c++:

  1. Ask the user for a beginning number between 1 and 100. If they enter a number outside the range, let them correct it.

  2. If the input number is ODD use that number. If it is not odd, add 1 to it.

    Ask how many sequential ODD numbers they wish to see.

Your output should be:

Example: If the user enters 22 and asks for 5 numbers, your output should be 25 27 29 31 33

  1. Allow the user to test many numbers until they tell you to stop.

  2. Test as follows:

    Enter the last 2 digits of your student ID and request sequential 7 numbers

    Enter the last 2 digits of your student ID and request -3 numbers. Display error message.

    Enter any number of your choosing as a third test

Paste the output as a comment to the bottom of your program. Copy the entire program and output. Go back to the Quiz and paste the answer to the essay question.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!