Advertisement
VelizarAvramov

08. Refactor Volume of Pyramid

Nov 14th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _08._Refactor_Volume_of_Pyramid
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //double dul, sh, V = 0;
  10.             //Console.Write("Length: ");
  11.             //dul = double.Parse(Console.ReadLine());
  12.             //Console.Write("Width: ");
  13.             //sh = double.Parse(Console.ReadLine());
  14.             //Console.Write("Heigth: ");
  15.             //V = double.Parse(Console.ReadLine());
  16.             //V = (dul + sh + V) / 3;
  17.             //Console.WriteLine("Pyramid Volume: {0:F2}", V);
  18.  
  19.  
  20.            
  21.             Console.Write("Length: ");
  22.             double length = double.Parse(Console.ReadLine());
  23.  
  24.             Console.Write("Width: ");
  25.             double width = double.Parse(Console.ReadLine());
  26.  
  27.             Console.Write("Height: ");
  28.             double height = double.Parse(Console.ReadLine());
  29.  
  30.             double volume = (length * width * height) / 3;
  31.             Console.WriteLine("Pyramid Volume: {0:F2}", volume);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement