using System.Collections.Generic;
namespace FunctionsandMethods
public static void Main( string [] args)
Console.WriteLine("Hi there! This program is going to calculate the volumes of four, three dimensional shapes, based on your input measurements. Press enter to start!");
Console.WriteLine("Your first 3D shape is a sphere. Enter the radius of your sphere:");
int radiusS = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Now, we are going to find the volume of your rectangular prism. First, enter the length of your rectangular prism:");
int lengthR = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Now, enter the width of your rectangular prism:");
int widthR = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Finally, please enter the height of your rectangular prism:");
int heightR = Convert.ToInt32(Console.ReadLine());
rectangularP( heightR, widthR, lengthR);
Console.WriteLine("Now, we are going to find the volume of your cylinder. First, please enter the radius of your cylinder:");
int radiusC = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Finally, please enter the height of your cylinder:");
int heightC = Convert.ToInt32(Console.ReadLine());
cylinder( heightC, radiusC);
Console.WriteLine("The last 3D shape we are going to find the volume of is your pyramid! First, please enter the height of your pyramid:");
int heightP = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Now, please enter the width of your pyramid:");
int widthP = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Finally, please enter the length of you pyramid:");
int lengthP = Convert.ToInt32(Console.ReadLine());
pyramid( heightP, widthP, lengthP);
public static void sphere( int radiusS)
Console.WriteLine("The volume of your sphere is " + ((4.0 / 3.0) * Math.PI * (Math.Pow(radiusS, 3))) + "! Press enter for the next shape!");
public static void rectangularP( int heightR, int widthR, int lengthR)
Console.WriteLine("The volume of your rectangular prism is " + (heightR * widthR * lengthR) + "! Press enter for the next shape!");
public static void cylinder( int radiusC, int heightC)
Console.WriteLine("The volume of your cylinder is " + (Math.PI * (Math.Pow(radiusC, 2)) * heightC) + "! Press enter for the last shape!");
public static void pyramid( int heightP, int widthP, int lengthP)
Console.WriteLine("The volume of your pyramid is " + ((lengthP * heightP * widthP)/3) + "!");
Console.WriteLine("The program will now self-destruct. Have a nice day!");