Advertisement
silvana1303

tennis equipment

Apr 25th, 2020
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int racket = int.Parse(Console.ReadLine());
  10.             int racketCount = int.Parse(Console.ReadLine());
  11.             int sneekersCount = int.Parse(Console.ReadLine());
  12.  
  13.             int racketCost = racket * racketCount;
  14.             double sneekers = racket / 6.0;
  15.             double sneekersCost = sneekers * sneekersCount;
  16.             double equipment = (racketCost + sneekersCost) * 0.2;
  17.             double fullSum = racketCost + sneekersCost + equipment;
  18.             double djoPrice = fullSum / 8.0;
  19.             double sponsors = fullSum - djoPrice;
  20.  
  21.             Console.WriteLine($"Price to be paid by Djokovic {Math.Floor(djoPrice)}");
  22.             Console.WriteLine($"Price to be paid by sponsors {Math.Ceiling(sponsors)}");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement