Write a C++ program called Lab3A.cpp that reads input from the keyboard and prints output to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program called Lab3A.cpp that reads input from the keyboard and prints output to the screen using cin and cout, respectively. Specifically, you are to write a C++ program that does the following to calculate the surface area of a cylinder as follows: r = radius h = height h • Assign the value 3.14 to a variable called pi. • Prompt for and read in the radius of the cylinder. • Prompt for and read in the vertical height of the cylinder. • Calculate the area of the trapezoid using the formula Area = 2πr2 + h(2πr) where r is the radius, h is the height, and it is pi. • Be sure to use the pow() function to calculate the radius squared. • Print the area result of the cylinder in a meaningful message to the terminal. Write a C++ program called Lab3A.cpp that reads input from the keyboard and prints output to the screen using cin and cout, respectively. Specifically, you are to write a C++ program that does the following to calculate the surface area of a cylinder as follows: r = radius h = height h • Assign the value 3.14 to a variable called pi. • Prompt for and read in the radius of the cylinder. • Prompt for and read in the vertical height of the cylinder. • Calculate the area of the trapezoid using the formula Area = 2πr2 + h(2πr) where r is the radius, h is the height, and it is pi. • Be sure to use the pow() function to calculate the radius squared. • Print the area result of the cylinder in a meaningful message to the terminal.
Expert Answer:
Answer rating: 100% (QA)
Here is a C program called Lab3Acpp that calculates the surface area of a cylinder using the provide... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Task #1 Correcting Logic Errors in Formulas 1. Copy the file NumericTypes.java (see Code Listing 2.1) from the Student CD or as directed by your instructor. 2. Compile the source file, run the...
-
Consider the points P(1, 2, k) and Q(2,-1, 1) and let u be the equivalent vector to the directed line segment PO. If us = 2, what is the value of k? A-1 OB. 1 OC2 D. 3 O EO
-
The day-to-day changes in weather for a certain part of the country form a Markov process. Each day is sunny, cloudy, or rainy. If it is sunny one day, there is a 70% chance that it will be sunny the...
-
Markway, Inc., is contemplating selling bonds. The issue is to be composed of 150 bonds, each with a face amount of $2,000. Required: 1. Calculate how much Markway is able to borrow if each bond is...
-
An electron moves in a straight line at a speed of \(6.0 \times 10^{7} \mathrm{~m} / \mathrm{s}\). Calculate the magnitude and direction of the magnetic field at a position \(5.0 \mathrm{~mm}\)...
-
The sales budget is usually the first and most crucial of the component budgets in a master budget because all other budgets usually rely on it for planning purposes. Required Assume that your...
-
Write the SOP Boolean expressions for the 7 outputs. [ 3 . 5 marks ]
-
A survey of 100 bank customers revealed that 58 of them have a savings account 63 of them have a checking account 22 of them have a savings account and a loan 16 of them have a checking account and a...
-
Find an entity that has made efforts to maintain or improve its ethical behavior, socialresponsibility, and/or diversity.Describe the entity, the entity's purpose, anddescribeits efforts to maintain...
-
In terms of Organization and management theories What are teamwork processes, and what are some examples of team activities that fall into this process category? What factors influence the...
-
The future value of a lump sum (single value) can be found using the following equation: FVN = PV x (1 I) N Suppose $2,000 was invested for three years in an account paying 10 percent interest. What...
-
In bread making, combining ingredients all at once, mixing to develop gluten, fermenting once or twice then proceeding with standard make-up procedures is known as Question 1 options: sour-dough...
-
Provide a calculation example for each of the following: o Patient's co-payment insurance portion = full reimbursement o Patient's co-insurance insurance portion = full reimbursement
-
Mary and Manny Muffler were involved in an auto accident several years ago with an uninsured motorist. The uninsured motorist was at fault and caused significant injuries to Mary. Because of her...
-
How does health insurance risk differ from other types of insurance risk (e.g., automobile or homeowners insurance)? What is the difference between cost sharing and cost shifting? Is retiree health...
-
Based on the dangling-else discussion in Exercise ANS: , state the output for each of the following code snippets when x is 9 and y is 11 and when x is 11 and y is 9. We eliminated the indentation...
-
Fill in the blanks in each of the following statements: a) The __________executes .NET programs. b) The CLR provides various services to __________code, such as integrating software components...
-
Write a C# statement or a set of C# statements to accomplish each of the following tasks: a) Sum the odd integers between 1 and 99, using a for statement. Assume that the integer variables sum and...
-
From output of your computer software, locate (a) the sum of squared errors, (b) the \(F\)-value for the overall significance of a regression model, (c) the estimated covariance matrix for the least...
-
Obtain restricted least squares estimates that include nonsample information in the estimation procedure.
-
Use the \(F\)-test to test single null hypotheses or joint null hypotheses.
Study smarter with the SolutionInn App