# How to use the "Input" command-- specific problem help

3 views (last 30 days)
Jay on 2 Feb 2014
Commented: Walter Roberson on 2 Feb 2014
I don't understand how to do the input command.. can someone help me?
The figure attached shows a cylindrical tank of height H and radius r, with a spherical cap on each end (also of radius r). The height of the liquid in the tank is h. Use the input command to obtain values for H, r & h and compute the volume of liquid in the tank.
The calculation of the volume of liquid in the tank depends upon the relationship between h, H and r:
• If h is less than r, we need the volume of a partially-filled sphere
• If h is greater than r but less than H-r, we need the volume of a fully- filed hemisphere plus the volume of a cylinder of height h-r
• If h is greater than H-r, we need the volume of a fully-filled sphere, plus the volume of a cylinder of height H-2r, minus the partially empty upper hemisphere of height H-h
• If h is greater than H, the function should generate an error message (using error)
Walter Roberson on 2 Feb 2014
The figure did not get attached.

Amit on 2 Feb 2014
The input command ask for a value from the user, for example
A = input('Enter value for h: ')
will show on command prompt:
Enter value for h:
Where the user will provide the value and that value will be store in the variable, here A.
For more about input, type on command prompt
help input