Advertisement
silvana1303

pool day

Apr 27th, 2020
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4.  
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int peopleCount = int.Parse(Console.ReadLine());
  11.             double entrance = double.Parse(Console.ReadLine());
  12.             double sunbedPrice = double.Parse(Console.ReadLine());
  13.             double umbrellaPrice = double.Parse(Console.ReadLine());
  14.  
  15.             double entranceMoney = peopleCount * entrance;
  16.             double sunbedMoney = Math.Ceiling(peopleCount * 0.75 ) * sunbedPrice;
  17.             double umbrellaMoney = Math.Ceiling(peopleCount * 0.50 ) * umbrellaPrice;
  18.  
  19.             double allMoney = entranceMoney + sunbedMoney + umbrellaMoney;
  20.  
  21.             Console.WriteLine($"{allMoney:f2} lv.");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement