Advertisement
vardanss

Refactor Volume Of Pyramid

May 30th, 2019
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RefactorVolumeOfPyramid
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double length, width, height = 0;
  10.             Console.Write("Length: ");
  11.             length = double.Parse(Console.ReadLine());
  12.             Console.Write("Width: ");
  13.             width = double.Parse(Console.ReadLine());
  14.             Console.Write("Height: ");
  15.             height = double.Parse(Console.ReadLine());
  16.             double volume = (length * width * height) / 3;
  17.             Console.WriteLine($"Pyramid Volume: {volume:f2}");
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement