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
Decrypt this message: P ht uva h zwf
KatRina [158]
Translation: I am a spy
5 0
3 years ago
Imagine you have borrowed your friend's computer to work on a class project. Checking
castortr0y [4]

Answer:

Yes.It would be considered as a computer Crime.

Explanation:

This is because you are an unauthorised user

6 0
4 years ago
Which one of the following items is an example of software?
Harlamova29_29 [7]
Word processing program is an example of a software. All the others, such as Printer, Keyboard and Mouse are examples of Computer peripheral devices or in short hardware devices. Generally these listed hardware devices come under input or output computer device category. Also, by classic meaning in layman terms these hardware components can be touched or felt. In contrast, a word processing program is a part of a computer system that consists of data or computing instructions and provides the mechanism to computer to perform a certain task utilizing it's hardware resources. Such components of computer system which are written using one of the computer languages are called computer software or software programs or simply software.
4 0
3 years ago
What is a fire wall and how does it work
Ostrovityanka [42]

Answer:

a firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules

8 0
3 years ago
What is included on the HP PC Hardware Diagnostics 3-in-1 USB Key that allows you to recover systems that cannot boot?
algol13

Answer:

HP PC Hardware Diagnostics UEFI

Explanation:

The 3-in-1 HP PC Hardware Diagnostics UEFI USB Key helps the client distinguish potential software, hardware, and Operating System issues. Both older and newer HP Desktop and Laptop PCs come with this tool installed. By default, it operates outside the OS to detach equipment issues from other system issues. In the event you do not have it pre-installed, you can get it from the official HP site.

3 0
4 years ago
Other questions:
  • Which is NOT a type of SD card?
    8·2 answers
  • How can a network design project benefit from the principles of itsm? How might itsm impede a network design project?
    11·1 answer
  • Drag each label to the correct image.
    9·2 answers
  • THIS IS PYTHON QUESTION
    11·1 answer
  • The first step to accurate coding is to identify the ___________ in the diagnostic statement.
    7·1 answer
  • What command should be executed to view the configuration of the nic?
    7·1 answer
  • List and describe each of the activities of technology
    11·1 answer
  • What are stored procedures? What kind of attack do stored procedures protect from? Identify two reasons why stored procedures ar
    14·1 answer
  • Read the following scenario. How might Sarah correct successfully complete her task?
    6·1 answer
  • Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!