Anzzhhela98

ffff

Jun 17th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loopsk
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double countMAgnozlia = double.Parse(Console.ReadLine());
  10.             double countZumbul = double.Parse(Console.ReadLine());
  11.             double countRose = double.Parse(Console.ReadLine());
  12.             double countKaktys = double.Parse(Console.ReadLine());
  13.             double priceGift = double.Parse(Console.ReadLine());
  14.  
  15.             double priceMagnolia = countMAgnozlia * 3.25;
  16.             double priceZumbul = countZumbul * 4;
  17.             double priceRose = countRose * 3.5;
  18.             double priceKaktys = countKaktys * 8;
  19.  
  20.             double totalPrice = (priceKaktys + priceMagnolia + priceRose + priceZumbul);
  21.             double afterProcent = totalPrice * 0.95;
  22.             if (afterProcent>=priceGift)
  23.             {
  24.                 Console.WriteLine($"She is left with {Math.Floor(afterProcent-priceGift)} leva.");
  25.             }
  26.             else
  27.             {
  28.                 Console.WriteLine($"She will have to borrow {Math.Ceiling(priceGift-afterProcent)} leva.");
  29.             }
  30.  
  31.  
  32.  
  33.  
  34.  
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment