daily pastebin goal
14%
SHARE
TWEET

toyshop

a guest Mar 25th, 2019 90 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 ToyShop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double tripPrice = double.Parse(Console.ReadLine());
  14.             int puzzles = int.Parse(Console.ReadLine());
  15.             int dolls = int.Parse(Console.ReadLine());
  16.             int bears = int.Parse(Console.ReadLine());
  17.             int minions = int.Parse(Console.ReadLine());
  18.             int trucks = int.Parse(Console.ReadLine());
  19.  
  20.             double puzzlesProfit = puzzles * 2.60;
  21.             double dollsProfit = dolls * 3;
  22.             double bearsProfit = bears * 4.10;
  23.             double minionsProfit = minions * 8.20;
  24.             double trucksProfit = trucks * 2;
  25.             double toysProfit = puzzlesProfit + dollsProfit + bearsProfit + minionsProfit + trucksProfit;
  26.             int toys = puzzles + dolls + bears + minions + trucks;
  27.  
  28.             if(toys >= 50)
  29.             {
  30.                 toysProfit -= toysProfit * 0.25;
  31.             }
  32.  
  33.             double profitAfterRent = toysProfit - toysProfit * 0.1;
  34.  
  35.             if(profitAfterRent >= tripPrice)
  36.             {
  37.                 Console.WriteLine("Yes! " + $"{(profitAfterRent - tripPrice):f2}" + " lv left.");
  38.             }
  39.             else
  40.             {
  41.                 Console.WriteLine("Not enough money! " + $"{Math.Abs(tripPrice - profitAfterRent):f2}" + " lv needed.");
  42.             }
  43.         }
  44.     }
  45. }
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