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
tekilochka [14]
3 years ago
7

Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2

× radius) Circumference (diameter × π) Surface area (4 × π × radius × radius) Volume (4/3 × π × radius × radius × radius)
Computers and Technology
1 answer:
SashulF [63]3 years ago
8 0

Answer:

#include<iostream>

using namespace std;

int main(){

   float radius;

   cout<<"Enter the radius of the sphere: ";

   cin>>radius;

   float diameter = 2*radius;

   float circumference = diameter * 3.14;

   float surface_area = 4*3.14*radius*radius;

   float volume = (4/3)*3.14*radius*radius*radius;

   cout<<"The diameter is: "<<diameter<<endl;

   cout<<"The circumference is: "<<circumference<<endl;

   cout<<"The surface area is: "<<surface_area<<endl;

   cout<<"The volume is: "<<volume<<endl;

}

Explanation:

First include the library iostream for input/output in c++ programming.

then, create the main function and declare the variable radius as floating type.

Use cout to print the message on the screen.

Use cin to store the value in the variable.

After that, write the formula to calculate the values and store the results in the variables.

and finally print the result with message.

You might be interested in
¿Cuales son las empresas mas exitosas que aún usan hoja de cálculo? porfa es urgentee
dem82 [27]

Answer:excel

Explanation:

6 0
2 years ago
Which option ie an example of an html end tag
Kay [80]
Any end tag in HTML needs to look like this, the word body used in this example is one of the more important elements, but you can replace it to any real element in HTML:
i.e. </body>
8 0
3 years ago
Which of the following is NOT a period of the Middle Ages?
frez [133]
High middle ages is the answer
5 0
3 years ago
1. Describe the sequencing of factors influencing health status codes for patients that also have chronic conditions being manag
Vesnalui [34]
Bubyggyy tvtvtvttfrcrt
4 0
3 years ago
What windows user interface can show you the programs that are currently active?
kirill115 [55]
Task manager
.............................
8 0
3 years ago
Other questions:
  • If you are a driver under 21 with a breath or blood alcohol level of ____ or higher, you will be required to attend a substance
    11·2 answers
  • The Status bar is used to control the majority of the drafting settings in AutoCAD
    13·1 answer
  • Explain what happens if you try to open a file for reading that does not exist.
    10·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    14·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • Create a Divisible application that displays a random integer between 1 and 100 and displays appropriate messages stating whethe
    5·1 answer
  • List and describe each of the activities of technology
    11·1 answer
  • Write pseudo code that performs the following: Ask a user to enter a number. If the
    13·1 answer
  • Write a recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression based o
    5·1 answer
  • One of the most notable impacts of IT on business is improved
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!