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
which of the following is a malicious program that can replicate and spread from computer to computer? A. Email B. Virus C. Spam
Svetlanka [38]
B. virus
i hope i helped you :)
8 0
3 years ago
Differentiate between patent and copyright.
gavmur [86]

Answer: Patent - securing an invention

Copyrights - securing original ideas

Both are governed by different rules and regulations and both are for different purposes.

Would appreciate brainly <3

5 0
2 years ago
Read 2 more answers
Edhesive 7.6 lesson practice python
spayn [35]

Answer:

(a) The output is -1

(b) The output is 32

Explanation:

Given: The above code

Solving (a): The output when 1, 1 and 1 is passed to the function

From the question, we have: print(mystery(x))

This means that only the value of x (which in this case is 1) will be passed to the mystery function

(a, b = 8, c = -6) will then be seen as: (a = 1, b = 8, c = -6)

2 * b + a + 3 * c = 2 * 8 + 1 + 3 * -6

2 * b + a + 3 * c = -1

<em>The output is -1</em>

Solving (b): The output when 8, 6 and 4 is passed to the function

From the question, we have: print(mystery(x,y,z))

This means that values passed to the function are: x = 8, y = 6 and z = 4

(a, b = 8, c = -6) will then be seen as: (a = 8, b = 6, c = 4)

2 * b + a + 3 * c = 2 * 6 + 8 + 3 * 4

2 * b + a + 3 * c = 32

<em>The output is 32</em>

6 0
2 years ago
What is an advantage of a computer network ? networked
sergij07 [2.7K]

1. Data is easy to backup as all data is stored on the file server.

2.Network users can communicate by email and instant messenger.

5 0
3 years ago
Read 2 more answers
Subscribe to epic beast brothers thank you
nikdorinn [45]
No ono moñón Ik Jkjkjk
5 0
3 years ago
Other questions:
  • Your client expresses that they want their new website to have a responsivedesign with consistent coding. They are concerned wit
    5·1 answer
  • A drop-down menu must be contained by
    5·1 answer
  • 50 pts DO NOT ANSWER FOR POINTS
    9·1 answer
  • I need the code for Assignment 5 Animation in Edhesive, its in python code.
    9·1 answer
  • How does technology helps save the environment?​
    6·1 answer
  • Write a program that displays the following menu:
    8·1 answer
  • How long does it take to send a 8 MiB file from Host A to Host B over a circuit-switched network, assuming: Total link transmiss
    11·1 answer
  • What is the positional weigh of the digit 7 in the octal number 7642 ?​
    15·1 answer
  • Use the drop-down menus to explain how to locate the Consolidate dialog box.
    6·1 answer
  • Which of the following are the most important reasons people in the 1920s were so interested in seeing lifelike stories in audio
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!