Advertisement
MARINA_GREBENAROVA

Football Kit

May 19th, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FootballKit
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             double priceTshirt = double.Parse(Console.ReadLine());
  11.             double sumForBall = double.Parse(Console.ReadLine());
  12.  
  13.             double priseShorts = priceTshirt * 0.75;
  14.             double pricestocks = priseShorts * 0.2;
  15.             double pricebutton = 2 * (priceTshirt + priseShorts);
  16.             double totallPrise = (priceTshirt + priseShorts + pricestocks + pricebutton);
  17.             double discount = totallPrise - (totallPrise * 0.15);
  18.  
  19.             if (totallPrise >= sumForBall)
  20.             {
  21.                 Console.WriteLine("Yes, he will earn the world-cup replica ball!");
  22.                 Console.WriteLine($"His sum is {discount:F2} lv.");
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine("No, he will not earn the world-cup replica ball.");
  27.                 Console.WriteLine($"He needs {Math.Abs(sumForBall - discount):F2} lv. more.");
  28.             }
  29.  
  30.          
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement