Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Write a C++ program that does the following: a. Create a C++ file with the name problem3.cpp. b. Prompt the user to enter

3. Write a C++ program that does the following: a. Create a C++ file with the name problem3.cpp. b. Prompt

3. 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 an integer from the range 1 to 20. But, if the user has not entered a correct integer after 10 attempts, then 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. 4. Write a C++ program that does the following: a. Create a C++ file with the name problem4.cpp. b. Print all the integers from 28 to 387 with ten integers (separated by spaces) per line using only a single loop, no nested loops. Sample partial run of the program: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 5. Write a C++ program that does the following: a. Create a C++ file with the name problem5.cpp. b. Prompt the user for an odd integer from the range 5 to 25, validating the input until the user enters an integer from the range 5 to 25. c. Print a table with n lines of output, where n is the number of odd integers between 1 and the user's integer. d. On output line number i, print each value of: i multiplied by one of the odd integers from 1 to n. Sample run of the program: Enter an odd integer from 5 to 25: 3 Invalid input! Enter an odd integer from 5 to 25:5 135 3915 5 15 25

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

Here are C programs for the tasks you described Problem 3 p... blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions