Advertisement
Spocoman

Football Kit

May 29th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FootballKit
  4. {
  5.     class Program
  6.     {
  7.         public static void Main()
  8.         {
  9.             double shirtPrice = double.Parse(Console.ReadLine());
  10.             double sum = double.Parse(Console.ReadLine());
  11.  
  12.             double shortsPrice = shirtPrice * 0.75;
  13.             double socksPrice = shortsPrice * 0.20;
  14.             double sneakersPrice = (shirtPrice + shortsPrice) * 2;
  15.  
  16.             double price = (shirtPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85;
  17.  
  18.             if (sum > price)
  19.             {
  20.                 Console.WriteLine("No, he will not earn the world-cup replica ball.");
  21.                 Console.WriteLine($"He needs {sum - price:f2} lv. more.");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine("Yes, he will earn the world-cup replica ball!");
  26.                 Console.WriteLine($"His sum is {price:f2} lv.");
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement