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

Dairy Farm decided to ship milk in containers in the form of cubes rather than cylinders. Write a program called ws4.cpp that pr

ompts the user to input the radius of the base and the height of a cylindrical container and outputs the side of the cube with the same volume as the cylindrical container.
Computers and Technology
1 answer:
Sonja [21]3 years ago
3 0

Answer:

1. #include <iostream>

2. #include <cmath>

3.  

4. using namespace std;

5.  

6. int main()

7. {

8.     float radius;  

9.     cout << "Type the radius of the base: "; // Type a number

10.     cin >> radius ; // Get user input from the keyboard

11.      

12.     float height;  

13.     cout << "Type the height: "; // Type a number and press enter

14.     cin >> height; // Get user input from the keyboard

15.      

16.     float volumeCylinder = 3.1416 * radius * radius * height;

17.     float cubeSide = std::pow(volumeCylinder, 1/3.);

18.     cout<<"Cube side is: "<< cubeSide;

19.      

20.     return cubeSide;

21. }

Explanation:

  • From line 1 to 5 we include two libraries
  • From line 6 to 7 we declare our main function
  • From line 8 to 11 we ask the user for the radius of the cylinder
  • From line 12 to 15 we ask the user for the height of the cylinder
  • On line 16 we calculate the volume of the cylinder using the formula        V=pi*(r^2)*h
  • On line 17 we calculate the side of the cube with the same volume as the cylindrical container using the formula side=∛(V)
  • From line 18 to 21 we print and return the value of the cube's side  
Download cpp
You might be interested in
​___________, such as smart phones and social​ media, fundamentally change the nature of an industry and can be influential enou
svlad2 [7]

Answer:

Disruptive Technologies.

Explanation:

Smart Phones and the social media are very power tools they can be used to spread a news like a fire very rapidly.

People mostly believe the new that come on their smartphones and the social media.

So the employees of the company can also be influenced by these technologies hence they can disrupt the work of the company and can make or break the company.

6 0
4 years ago
Using a Windows computer, to make a window wider, you would move the pointer until it changes to the Horizontal Resize shape and
weqwewe [10]
Press and hold the left button on the mouse and drag window until it is the size youwant
4 0
3 years ago
What happens by default when you copy a formula from one cell to another cell?
natta225 [31]
By default, all cell references are relative references. When copiedacross multiple cells, they change based on the relative position of rows and columns. For example, if you copy the formula =A1+B1 from row 1 to row 2, the formula will become =A2+B2.
8 0
3 years ago
Select the correct answer. Which type of software do you generally not need to pay for? A. software available online B. closed-s
Alex

Answer:open-source software

Explanation:

5 0
3 years ago
5.10 (Find the highest score) Write a program that prompts the user to enter the number of students and each student's score, an
lbvjy [14]

Answer:

Python Program for the task.

#Ask the user to input the number of students

n = int(input("Please enter the number of students:\n"))

print()

#Get students' scores

for i in range(n):

score_list = [ ] #placeholder for score

i = float(input("Please enter student's score:"))

score_list.append(i) # append student score

#print the highest score

print("The highest score is",max(score_list))

6 0
3 years ago
Other questions:
  • Suppose a subnet has a prefix 128.119.44.128/26. Give an example of an IP address from this subnet. If an ISP owns a block of ad
    14·2 answers
  • List seven basic internal components found in a computer tower
    13·1 answer
  • Why do we use console.log in javascript when changing variables?
    15·2 answers
  • I just want to ask if some one know an online school program that offer a live session and the cost of it not to expensive. for
    10·1 answer
  • What is responsible for coordinating a computer's hardware and software components?
    13·1 answer
  • A(n) ____________ for a computer program is a set of steps that explains how to begin with known information specified in a prob
    5·1 answer
  • 97 points pleaseeee helpppp
    8·2 answers
  • *
    6·2 answers
  • BRAINLIEST 14 points
    7·2 answers
  • The process of identifying and eliminating bugs in a software program is most generally called reproducing the problem. diagnosi
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!