Advertisement
Valantina

PoolDay/Exam

Jul 9th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P01_PoolDay
  4. {
  5.     class P01_PoolDay
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int people = int.Parse(Console.ReadLine());
  10.             double entranceTax = double.Parse(Console.ReadLine());
  11.             double loungePrice = double.Parse(Console.ReadLine());
  12.             double umbrellaPrice = double.Parse(Console.ReadLine());
  13.  
  14.             double totalEnterPrice = entranceTax * people;
  15.             double loungeCnt = Math.Ceiling(people * 0.75);
  16.             double umbrellaCnt = Math.Ceiling(people / 2.0);
  17.  
  18.             double finalPrice = totalEnterPrice + loungeCnt * loungePrice + umbrellaCnt * umbrellaPrice;
  19.  
  20.             Console.WriteLine($"{finalPrice:F2} lv.");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement