3. Write a C++ program that does the following: a. Create a C++ file with the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Here are C programs for the tasks you described Problem 3 p... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Internal auditors at Henry Flower's Flower Shop are undertaking a comprehensive review to determine if the company has complied with privacy regulations regarding customer data. In the Control...
-
It takes the same amount of time to double all three accounts ($100, $200, $500). All three accounts take 13.863 to double. What can we determine about the starting amount and doubling time?
-
Please do the following Matlab problem, 1.Write a for loop ranging from 3 to 5. In the loop, print the value of the loop index to the screen using fprintf in the following format: Value is n where n...
-
A partially completed flowchart showing some of the major documents commonly used in the purchasing function of a merchandise business is presented below. Identify documents 1, 3, and4. Purchase Order
-
Sketch the streamlines, especially the body shape, due to equal line sources m at (0, +a) and (0, a) plus a uniform stream U∞ = ma. m 3- m
-
Sketch the graph of a function f that satisfies all the following conditions. (a) Its domain is [-2, 2]. (b) f(-2) = f(-1) = f(1) = f(2) = 1. (c) It is discontinuous at - 1 and 1. (d) It is right...
-
How do you classify the pumps?
-
The adjusted trial balance of Doqe Company shows these data pertaining to sales at the end of its fiscal year. October 31, 2017: Sales Revenue $900,000, Freight-Out $14,000, Sales Returns and...
-
EMMA WATSON, STEPHEN WATSON, CARTER OLIVIERA, an infant under the age of eighteen years by his Litigation Guardian, EMMA WATSON and ABIGAIL OLIVIERA, an infant under the age of eighteen years, by her...
-
Based on a 2018 study, the average elapsed time between when a user navigates to a website on a mobile device until its main content is available was 14.6 seconds. This is more than a 20% increase...
-
Discuss what you see as the future of the practice of psychology in the Caribbean and show how the principles of the Cognitive psychology theory have shaped the development of psychology and will...
-
Eileen's filing status is head of household. She owns and operates a hardware store, which has the following revenues and expenses for the current year. Revenue Expenses: Cost of goods sold Property...
-
1. Consider a portfolio of a stock and a short call option with the following properties. A. Stock price is currently $30. B. In 3 months, it will be either $32 or $28. C. Call option expiration is 3...
-
There are many different types of business messages forms, and each has its own unique traits and purpose. Every business communication situation requires analysis to determine which type of message...
-
Consider a metal sheet that is 2 mm thick and has an area of 500 cm2 separating two chambers containing different gas atmospheres. One chamber contains a 1:9 nitrogen/argon mixture, and the other...
-
Quality Brick Company produces bricks in two processing departments-Molding and Firing. Information relating to the company's operations in March follows: a. Raw materials used in production: Molding...
-
A company is considering the purchase of a new piece of equipment that costs $50,500 and will have a salvage value of $5,050 after 9 years. Using the new piece of equipment will increase annual cash...
-
The activities listed in lines 2125 serve primarily as examples of A) Underappreciated dangers B) Intolerable risks C) Medical priorities D) Policy failures
-
Van makes an investment in a partnership in 2012. Van's capital contributions to the partnership consisted of $30,000 cash and a building with an adjusted basis of$70,000, subject to a nonrecourse...
-
Abigail (Abby) Boxer is a single mother working as a civilian accountant for the U.S. Army. Her Social Security number is 676-73-3311 and she lives at 3456 Alamo Way, San Antonio, TX 78249. Helen,...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
You are setting up a chatbot agency to service marketing, sales and customer services teams. Discuss the advantages and disadvantages of setting up the business as a sole trader or company and the...
-
Principles for Responsible Management Education (PRME) is a not-for-profit entity. It engages business schools to ensure they provide future leaders with the skills needed to balance economic and...
-
Entities are expected to perform in environmental, governance and social areas as well as profit (unless a not-for-profit entity). List some key performance indicators applicable to each sphere.
Study smarter with the SolutionInn App