Dianov

Data Types and Variables - Lab (11. Refactor Volume of Pyramid)

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