Program prompts the user to input the height and the radius

Assignment Help C/C++ Programming
Reference no: EM13339800

Consider the following program in which the statements are in the incorrect order. Rearrange the statements so that the program prompts the user to input the height and the radius of the base of a cylinder and outputs the volume and surface area of the cylinder. Format the output to two decimal places.

#include <iomanip>
#include <cmath>
int main()
{}
double height;
cout << "Volume of the cylinder = "
<< PI * pow(radius, 2.0)* height << endl;
cout << "Enter the height of the cylinder: ";
cin >> radius;
cout << endl;
return 0;
double radius;
cout << "Surface area: "
<< 2 * radius * + 2 * PI * pow(radius, 2.0) << endl;
cout << fixed << showpoint << setprecision(2);
cout << "Enter the radius of the base of the cylinder: ";
cin >> height;
cout << endl;
#include <iostream>
const double PI = 3.14159;
using namespace std;

Reference no: EM13339800

Questions Cloud

Industry price and output will approach the outcome for : Assume the firms in an oligopoly produce a differentiated product and are initially colluding. If each firm begins to cheat (to increase sales) by underpricing the other firms, as the amount of cheating increases, the resulting industry price and out..
Write a value-returning function : Write a program that uses the function isNumPalindrome given(Palindrome Number). Test your program on the following numbers: 10, 34, 22, 333, 678, 67876, 44444, and 123454321.
How much work is done by the engine in each cycle : An engine absorbs 1.74 kJ from a hot reservoir at 277°C and expels 1.21 kJ to a cold reservoir at 27°C in each cycle. How much work is done by the engine in each cycle
Find the work done by the aluminum : A 7.1-kg block of aluminum is heated from 30°C to 60°C at atmospheric pressure. Find the work done by the aluminum
Program prompts the user to input the height and the radius : Rearrange the statements so that the program prompts the user to input the height and the radius of the base of a cylinder and outputs the volume and surface area of the cylinder. Format the output to two decimal places.
Calculate the charge density of the air-assumed constant : At an altitude of 260 m above the Earth's surface, the field is only 105 N/C. Calculate the charge density of the air (assumed constant).
Law of supply and the determinants of supply : How can I explain explain the market equilibrating process in relation to the following: Law of demand and the determinants of demand
Evaluate swobodavilles financial condition : Evaluate Swobodaville's financial condition based on the partial list of factors given. That is, consider any observable trends in the data and what they could potentially mean. To compare the data, in some cases it is best to convert dollar figur..
What is the magnitude of the flux through the rectangle : In a uniform electric field of magnitude E, the field lines cross through a rectangle of area A at an angle of 79.0° with respect to the plane of the rectangle. What is the magnitude of the flux through the rectangle

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd