Advertisement
tsvetelinapasheva

TsvetelinaPasheva/FirstStepInCodingExercise/08.FishTank

Jan 10th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _08.FishTank
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int lenghtInCm = int.Parse(Console.ReadLine());
  10.             int widthInCm = int.Parse(Console.ReadLine());
  11.             int heightInCm = int.Parse(Console.ReadLine());
  12.             double percentage = double.Parse(Console.ReadLine());
  13.  
  14.             double liter = 0.001;
  15.             double volumeOfAquarium = lenghtInCm * widthInCm * heightInCm;
  16.             double litersCollect = volumeOfAquarium * liter;
  17.             double percentageOfWater = percentage * 0.01;
  18.             double litersNeeded = volumeOfAquarium * (1 - percentageOfWater);
  19.             Console.WriteLine(litersNeeded*0.001);
  20.  
  21.  
  22.  
  23.         }
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement