SHARE
TWEET

Untitled

madeofglass Feb 27th, 2020 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _02.Shopping
  4. {
  5.     class Shopping
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             double numVideoCards = double.Parse(Console.ReadLine());
  11.             double numProcessors = double.Parse(Console.ReadLine());
  12.             double numRamMemory = double.Parse(Console.ReadLine());
  13.  
  14.             double priceVideoCards = numVideoCards * 250.0;
  15.             double priceProcessor = numProcessors * (priceVideoCards * 0.35);
  16.             double priceRamMemory = numRamMemory * (priceVideoCards * 0.10);
  17.  
  18.             double all = priceVideoCards + priceProcessor + priceRamMemory;
  19.  
  20.             if (numVideoCards > numProcessors)
  21.             {
  22.                 all = all * 0.85;
  23.             }
  24.  
  25.             double difference = Math.Abs(budget - all);
  26.  
  27.             if (budget >= all)
  28.             {
  29.                 Console.WriteLine($"You have {difference:f2} leva left!");
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine($"Not enough money! You need {difference:f2} leva more!");
  34.             }
  35.  
  36.         }
  37.     }
  38. }
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