Dianov

First Steps In Coding - Exercise (08. Fish Tank (not included in final score))

Oct 13th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace FishTank
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int lenght = int.Parse(Console.ReadLine());
  14.             int height = int.Parse(Console.ReadLine());
  15.             int width = int.Parse(Console.ReadLine());
  16.             double percentages = double.Parse(Console.ReadLine());
  17.  
  18.             int volumeCM = lenght * width * height;
  19.             double volumeDM = volumeCM * 0.001;
  20.             double percent = percentages * 0.01;
  21.             double waterVolume = volumeDM * (1 - percent);
  22.             Console.WriteLine(waterVolume);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment