SHARE
TWEET

Untitled

a guest May 29th, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         double cenaNaEkskurzia = double.Parse(Console.ReadLine());
  7.         int broiPazeli = int.Parse(Console.ReadLine());
  8.         int govoreshtiKukli = int.Parse(Console.ReadLine());
  9.         int plusheniMecheta = int.Parse(Console.ReadLine());
  10.         int minioni = int.Parse(Console.ReadLine());
  11.         int kamioncheta = int.Parse(Console.ReadLine());
  12.  
  13.         double cenaPazel = 2.60;
  14.         double cenaKukla = 3;
  15.         double cenaMeche = 4.10;
  16.         double cenaMinion = 8.20;
  17.         double cenaKamion = 2;
  18.  
  19.         double sumOfProducts = (broiPazeli * cenaPazel) + (govoreshtiKukli * cenaKukla) +
  20.             (plusheniMecheta * cenaMeche) + (minioni * cenaMinion) + (kamioncheta * cenaKamion);
  21.         if ((broiPazeli + govoreshtiKukli + plusheniMecheta + minioni + kamioncheta) >= 50)
  22.         {
  23.             sumOfProducts = sumOfProducts - (0.25 * sumOfProducts);
  24.         }
  25.         sumOfProducts = sumOfProducts - (0.1 * sumOfProducts);
  26.         if (sumOfProducts > cenaNaEkskurzia)
  27.         {
  28.             Console.WriteLine("Yes! {0:F2} lv left.", (Math.Abs(cenaNaEkskurzia - sumOfProducts)));
  29.         }
  30.         else
  31.         {
  32.             Console.WriteLine("Not enough money! {0:F2} lv needed.", (Math.Abs(cenaNaEkskurzia-sumOfProducts)));
  33.         }
  34.  
  35.     }
  36. }
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