Advertisement
Guest User

Untitled

a guest
Dec 6th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.81 KB | None | 0 0
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Xml;
  4.  
  5. class Program
  6. {
  7.     public static void Main(string[] args)
  8.     {
  9.         //⦁   Пъзел - 2.60 лв.
  10.         //⦁   Говореща кукла - 3 лв.
  11.         //⦁   Плюшено мече - 4.10 лв.
  12.         //⦁   Миньон - 8.20 лв.
  13.         //⦁ Камионче - 2 лв.
  14.  
  15.         double priceForExursion = double.Parse(Console.ReadLine());
  16.         int countPuzzles = int.Parse(Console.ReadLine());
  17.         int countDolls = int.Parse(Console.ReadLine());
  18.         int bearToys = int.Parse(Console.ReadLine());
  19.         int minionsToys = int.Parse(Console.ReadLine());
  20.         int truckToys = int.Parse(Console.ReadLine());
  21.  
  22.         double countPuzzlesPrice = countPuzzles * 2.60;
  23.         double countDollsPrice = countDolls * 3;
  24.         double bearToysPrice = bearToys * 4.10;
  25.         double minionsToysPrice =minionsToys * 8.20;
  26.         double trucKToysPrice= truckToys * 2;
  27.  
  28.         double sum = countPuzzlesPrice + countDollsPrice + bearToysPrice + minionsToysPrice + trucKToysPrice;
  29.         int sumOfToys = countPuzzles + countDolls + bearToys + minionsToys + truckToys;
  30.         double disc = 0;
  31.         double calcDisc = 0;
  32.         if (sumOfToys>=50)
  33.         {
  34.             calcDisc = sum * 0.25;
  35.         }
  36.              disc = sum - calcDisc;
  37.         double rent = disc * 0.1;
  38.  
  39.  
  40.         double result = disc - rent;
  41.  
  42.         double leftMonet = result - priceForExursion;
  43.         if (result >=priceForExursion)
  44.         {
  45.             Console.WriteLine($"Yes! {leftMonet:f2} lv left.");
  46.         }
  47.  
  48.         double needMoney = priceForExursion - result;
  49.         if (result<priceForExursion)
  50.         {
  51.             Console.WriteLine($"Not enough money! {needMoney:f2} lv needed.");
  52.         }
  53.  
  54.  
  55.  
  56.  
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement