SHARE
TWEET

Untitled

a guest Dec 8th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             //Input
  15.             double breadPrice = double.Parse(Console.ReadLine());
  16.             double breadCount = double.Parse(Console.ReadLine());
  17.             double kozunaciCount = double.Parse(Console.ReadLine());
  18.             double gevreciCount = double.Parse(Console.ReadLine());
  19.             double kroasaniCount = double.Parse(Console.ReadLine());
  20.  
  21.             double budget = double.Parse(Console.ReadLine());
  22.  
  23.             //Calcs
  24.             double kozunaciPrice = breadPrice * 1.2;
  25.             double gevrekPrice = kozunaciPrice * 0.6;
  26.             double kroasanPrice = gevrekPrice + 1.20;
  27.  
  28.             double Total = breadPrice * breadCount + kozunaciPrice * kozunaciCount + gevrekPrice * gevreciCount + kroasanPrice * kroasaniCount;
  29.  
  30.             if (Total <= budget)
  31.             {
  32.                 Console.WriteLine($"Yes! {Math.Abs(Total - budget):F2} leva left.");
  33.             }
  34.             else
  35.             {
  36.                 Console.WriteLine($"No!  {Math.Abs(Total - budget):F2} leva need.");
  37.             }
  38.  
  39.  
  40.  
  41.  
  42.         }
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top