DyNaMiXx7

Untitled

Oct 28th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         double widthOfSpaceship = double.Parse(Console.ReadLine());
  8.         double lengthOfSpaceship = double.Parse(Console.ReadLine());
  9.         double heightOfSpaceship = double.Parse(Console.ReadLine());
  10.         double averageHeight = double.Parse(Console.ReadLine());
  11.  
  12.         double racketArea = widthOfSpaceship * lengthOfSpaceship * heightOfSpaceship;
  13.         double roomArea = (averageHeight + 0.40) * 2 * 2;
  14.         double astonautsNumber = Math.Floor(racketArea / roomArea);
  15.         if (astonautsNumber > 10)
  16.         {
  17.             Console.WriteLine("The spacecraft is too big.");
  18.         }
  19.         else if (astonautsNumber >= 3 && astonautsNumber <= 10)
  20.         {
  21.             Console.WriteLine($"The spacecraft holds {astonautsNumber} astronauts.");
  22.         }
  23.         else if (astonautsNumber < 3)
  24.         {
  25.             Console.WriteLine($"The spacecraft is too small.");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment