In this example write a program that reads in the radius and length of a cylinder and computes the area and volume.
Here is a sample run:
Breaking it down
Sticking to the basics and reading two numbers from the user that represent the radius and length of a cylinder we will pass those values to calculateArea and calculateVolume. Finally we will output the calculations back to the console. Remember, in its current state the program doesn't validate the users input which could lead to errors.