C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Question
Chapter 1.3, Problem 8E
(a)
Program Plan Intro
To determine the number of outputs required for the given
(b)
Program Plan Intro
To determine the number of inputs required for the given program.
(c)
Program Plan Intro
To determine the formula for converting input items into outputs items.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Note: You've already written psuedocode of this problem in Homework 1: Question 2. You just need to convert it to C++ code to solve this question.
You’re planning a ski trip for later this semester! You want to know how much snow each Colorado resort will have by that time.
Write a program to estimate the number of inches of snow Breckenridge, Vail, and Copper Mountain will have after a certain number of days (X) and display the output. X will be taken as a user input. Currently, there are 25 inches in Breckenridge, 28 inches at Vail, and 40 at Copper Mountain.
The resorts have provided us with the snowfall and melt rate predictions per day (mentioned below) to come up with an accurate estimation. Assume these rates stay the same for all future days. The rates do not depend on the current number of inches at each resort.
Hint: You will never end up with a negative snow depth.
Resort
Snowfall rate (inches/day)
Melt rate (inches/day)
Breckenridge
10
5
Vail
14
2
Copper Mountain…
program used is C++
(Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied.
However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance.
How many units should be rented to maximize the profit?
Instructions
Write a program that prompts the user to enter:
The total number of units.
The rent to occupy all the units.
Amount to maintain a rented unit.
The increase in rent that results in a vacant unit.
The program then outputs:
The number of units to be rented to maximize the profit
The maximum profit
Since your program handles currency, make sure to use a data type that can store decimals with a decimal precision of 2.
[THIS IS NOT GRADED] The question mentions the bouncy program; this is the bouncy program I have written that computes the total distance traveled by the ball given initial height, bounciness index, and number of bounces:
height = float(input("Enter the height from which the ball is dropped: "))
bounciness = float(input("Enter the bounciness index of the ball: "))
distance = 0
bounces = int(input("Enter the number of times the ball is allowed to continue bouncing: "))
for eachPass in range(bounces):
distance += height
height *= bounciness
distance += height
print('\nTotal distance traveled is:', distance, 'units.')
I will attatch the pre-existing code that the question provided.
Thank you for your help.
Chapter 1 Solutions
C++ for Engineers and Scientists
Ch. 1.1 - (Practice) a. To convert inches (in) to feet (ft),...Ch. 1.1 - (Conversion) Blood pressure is the force of blood...Ch. 1.1 - Prob. 3ECh. 1.1 - Prob. 4ECh. 1.1 - (Practice) a. Determine the conversion factors...Ch. 1.1 - Prob. 6ECh. 1.1 - (Automotive) a. An automobile engine’s performance...Ch. 1.1 - (Chemistry) a. Determine the final units of the...Ch. 1.1 - (Oceanography) The pressure, P, exerted on an...Ch. 1.1 - (Thermodynamics) The work, W, performed by a...
Ch. 1.2 - (Practice) Convert the following numbers from...Ch. 1.2 - Prob. 2ECh. 1.2 - Prob. 3ECh. 1.2 - Prob. 4ECh. 1.2 - Prob. 5ECh. 1.2 - Prob. 6ECh. 1.2 - Prob. 7ECh. 1.3 - (Electrical eng.) You’ve been asked to write a C++...Ch. 1.3 - (Physics) You’ve been asked to write a program to...Ch. 1.3 - (Electrical eng.) You’ve been asked to write a...Ch. 1.3 - Prob. 4ECh. 1.3 - (General math) Consider the following programming...Ch. 1.3 - Prob. 6ECh. 1.3 - (Statistics) This is the formula for the standard...Ch. 1.3 - Prob. 8ECh. 1.4 - (Practice) Determine a step-by-step procedure...Ch. 1.4 - Prob. 2ECh. 1.4 - Prob. 3ECh. 1.4 - Prob. 4ECh. 1.4 - Prob. 5ECh. 1.4 - (Numerical) a. Write a set of detailed,...Ch. 1.4 - (Data processing) a. Write an algorithm to locate...Ch. 1.4 - (Data processing) Determine and write an algorithm...Ch. 1.4 - (Numerical) Determine and write an algorithm to...Ch. 1 - (Conversion) Determine which of the following...Ch. 1 - (Conversion) An object’s polar moment of inertia,...Ch. 1 - Prob. 3PPCh. 1 - Prob. 4PPCh. 1 - Prob. 5PPCh. 1 - Prob. 6PPCh. 1 - Prob. 7PPCh. 1 - Prob. 8PP
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- NOTE: Solve this as soon as possible, I need this urgently. One large chemical company pays its salespeople on a commission basis. The salespeople each receive 200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells 5000 worth of chemicals in a week receives 200 plus 9 percent of 5000, or a total of 650. Develop a C++ program that uses a while statement to input each salesperson's gross sales for last week and calculates and displays that salesperson's earnings. Process one salesperson's figures at a time. Enter sales (-1 to end): 5000.00 Salary is: 650.00 Enter sales (-1 to end): 6000.00 Salary is: 740.00 Enter sales (-1 to end): 7000.00 Salary is: 830.00 Enter sales (-1 to end) : -1arrow_forwardAnswer properly(editable code , output screenshot) is must Write a C++ program to input electricity unit charges and calculate total electricity bill according to the given condition:For first 50 units Rs. 0.50/unitFor next 100 units Rs. 0.75/unitFor next 100 units Rs. 1.20/unitFor unit above 250 Rs. 1.50/unitAn additional surcharge of 20% is added to the billarrow_forwardI need help writing a C++ code. I need the code to show the current rate for a country club prices. The starting Prices start at 3000 for a year and raise 3% each year for 5 years. I need a program that will loop to display the projected rates for each of the next 5 years.arrow_forward
- NOTE: Solve this as soon as possible, I need this urgently. Illustrate your knowledge of C-Programming by writing a user defined function to solve the quadratic equation. Function will take a, b and c as input and compute and return both the roots of the quadratic equation. If roots are imaginary, function will return -1 as the error value for both the roots. In main(), ask the user to enter values of a, b and c and call the user defined function. At the end, main() will display both the roots returned by the function on screen. -6±/b² –4ac 2a X =arrow_forward-) Write a complete C++ program that takes the users' weight and their lifestyle as an input and recommends the number of calories they should take per day. Your program needs to take users' weight as an integer value and their lifestyle as a character that shows if they are active (a) or sedentary (inactive) (s). Your program then calculates the number of calories by multiplying the users' weight with the activity factor. If the person is sedentary, that person's activity factor is 13. If the person is active, that person's activity factor is 15. Sample Run Please enter your weight: 60 Do you have an active (a) or sedentary (s) lifestyle? s The recommended number of calories: 780arrow_forward(C PROGRAMMING ONLY) 6. Deal or No Deal?by CodeChum Admin When I was a kid, I used to watch this TV game show, Deal or No Deal? In the game, there are different brief cases, each labeled with a number. Inside each brief case is an amount in Pesos and the goal is to guess which briefcase contains the smallest amount. In this program, instead of just finding the smallest amount, your task is to ask the user for an integer input and print the values in the array smaller than the inputted integer. Instructions: In the code editor, you are provided with an array with 100 elements.Your task is to ask the user for an integer input and then print all the elements in the array whose value is lesser than the inputted integer.Input 1. Inputted integer Output Enter value: 6132450351503022244arrow_forward
- Q1 / A chemical sensor works to read the value of pollution in four industrial sites every four hours a day, so you want to write a program in C ++ language that works to read the pollution values in those sites and find the rate of pollution in each site and the highest rate of pollution?arrow_forwardQuestion The Area, A, of a rectangle is given by the formula A where L is the rectangle's length, W is the rectangle's width. ). Use this information to write a complete C ++ program that asks the user to enter 10 values of length and width measurements, one at a time, and then the program calculates for each value entered the Area of a rectangle Using a for loop.arrow_forwardUsing C++ Program, please help me code this problem. The utilities commission has decided that the electric company overcharged its customer for 2 months last year. To make up the difference to the customers, the commission orders the company to decrease each of next month’s bill by 10%. The city also levies a 3% utility tax, which is to be applied to the bill before it is discounted. Also, the 10% discount does not apply to the utility tax. Assume electricity costs 25.50 per kilowatt. Create the program to compute for next month’s electricity bill.arrow_forward
- Simon is new to mathematics. He need help in finding out the area of the intersection of the triangle and the three circles. Assume that there is an equilateral triangle XYZ with side length 2*a and there are three circles with centres at the midpoints of sides XY, YZ and ZX respectively and radius of them are r1, r2 and r3 respectively. You are required to develop a C++ program that compute the area of the intersection of the triangle and the three circles. Test Case 1: 1 10 19 20 18 Result: 173.702500arrow_forwardFor the program below, assume that a point on a Cartesian plane comprises values representing x and y coordinates. The distance between two points in a Cartesian plane can be calculated using the formula derived from d=√((x2-x1)²+(y2-y1)²). Write a C++ program that prompts a user to input two points on the Cartesian plane and works out the distance between them. Use comments in your code, highlight how you have used the following concepts of C++ : class, object, constructors and destructors.arrow_forwardLanguage: C++ (Apartment problem) A real estate office handles , say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: The total number of units. The rent to occupy all the units. The increase in rent that results in a vacant unit. Amount to maintain rented unit. The program then outputs the number of units to be rented to maximize the profit. Note: Please include the pseudocodearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License