Advertisement
Spocoman

Tennis Equipment

Nov 28th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TennisEquipment
  4.  
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double racketPrice = double.Parse(Console.ReadLine());
  11.             int racketCount = int.Parse(Console.ReadLine());
  12.             int sneakersCount = int.Parse(Console.ReadLine());
  13.             double racketsSum = racketPrice * racketCount;
  14.             double sneackersSum = racketPrice / 6 * sneakersCount;
  15.             double price = (racketsSum + sneackersSum) + ((racketsSum + sneackersSum) * 0.2);
  16.  
  17.             Console.WriteLine($"Price to be paid by Djokovic {Math.Floor(price / 8)}");
  18.             Console.WriteLine($"Price to be paid by sponsors {Math.Ceiling(price * 7 / 8)}");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement