Advertisement
Valantina

Tennis Equipment/Exam

Jun 13th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Tennis Equipment
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double tenisRocketPriceEach = double.Parse(Console.ReadLine());
  10.             double tenisRocketsCount = double.Parse(Console.ReadLine());
  11.             double sneakers = double.Parse(Console.ReadLine());
  12.             double tenisRocketPrice = tenisRocketPriceEach * tenisRocketsCount;
  13.             double pairOfSneakers = (tenisRocketPriceEach / 6) * sneakers;
  14.             double otherEquipment = (tenisRocketPrice + pairOfSneakers) * 0.2;
  15.             double total = tenisRocketPrice + pairOfSneakers + otherEquipment;
  16.             Console.WriteLine($"Price to be paid by Djokovic {Math.Floor(total / 8)}");
  17.             double SevenEight = (double)7 / 8;
  18.             Console.WriteLine($"Price to be paid by sponsors {Math.Ceiling(SevenEight * total)}");
  19.  
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement