1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lakkis [162]
3 years ago
6

C++ CODE

Computers and Technology
1 answer:
cestrela7 [59]3 years ago
7 0

Answer:

#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;

int main()

{

   const double PI = 3.14159;

   double height;

   double radius;

   

   cout << "Enter the height of the cylinder: ";

   cin >> height;

   cout << "Enter the radius of the base of the cylinder: ";

   cin >> radius;

   cout << endl;

   cout << "Volume of the cylinder = " << setprecision(4) << PI * pow(radius, 2.0) * height << endl;

   cout << "Surface area: " << setprecision(4) << 2 * PI * radius * height + 2 * PI * pow(radius, 2.0) << endl;

   cout << endl;

   return 0;

}

Explanation:

Code is rearranged so that;

- Variables are defined,

- <em>height</em> and <em>radius</em> of the cylinder is asked from the user,

- The <u>volume</u> and <u>surface area</u> of the cylinder are calculated and printed. (<u>setprecision(4)</u> is used to print two decimal values)

You might be interested in
Text that is heavier or darker than other text in the document is considered _____.
kvv77 [185]

The text that is heavier or darker than other text in a document is considered  Bold.

Hope this helped!~

7 0
3 years ago
Read 2 more answers
Isa wants to find out if his co-worker Alexis is available for an event on Wednesday, February 10th. Which calendar
Elena-2011 [213]
Appoint view
Hope this helps
7 0
3 years ago
I have the assembly for the max. can someone change the variables of it and make it min. I mean, the assembly for finding the mi
tatyana61 [14]
Bruh i honeselty dont know
4 0
3 years ago
What natural resources products are discussed in the article? Are they renewable or nonrenewable?
Alex

Where is the article

4 0
3 years ago
Read 2 more answers
When resizing images or objects in a presentation, why should a user not utilize the sizing handles in the middle of the sides o
Volgvan

Answer:

b. It will resize the image but not maintain aspect ratio

Explanation: is correct. post protected

7 0
2 years ago
Other questions:
  • The concept of vertical farming allows agriculture to occur when there is not enough___Available .
    13·1 answer
  • Twitter is an example of a __________. social bookmarking website social tagging website microblogging website blogging website
    12·1 answer
  • Your mom is trying to save room on her hard drive and wants to uninstall some of her applications. She asks you how to do this.
    9·2 answers
  • Consider the following code segment.
    15·1 answer
  • it is used to hold screws, jumpers, fasteners, and other small parts and prevent them from getting mixed together​
    15·2 answers
  • What is the plan to make optimum usage of available spaces?
    15·1 answer
  • What is the missing part to have the output as 3 2 1 while count &gt;0 : print(count) count -= 1
    10·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • write code to print out all combinations of pairs of numbers 1 through m and 1 through n, separated by a comma
    10·1 answer
  • The page that appears when you first open your Internet browser is the _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!