Question: 1 . Write a C + + program that does the following: a . Create a C + + file with the name problem 3

1. Write a C++ program that does the following:
a. Create a C++ file with the name problem3.cpp.
b. Prompt the user to enter an integer from the range 1 to 20, validating the input until the user enters a correct integer. If the user fails to input a correct integer after 10 attempts, the program chooses 10 as the user's integer.
c. Print the cube of the user's integer.
Sample run of the program:
Enter an integer between 1 and 20: 100
Out of range. Enter an integer between 1 and 20: -1
Out of range. Enter an integer between 1 and 20: 5
The cube of your integer is 125.

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 Programming Questions!