Advertisement
ivanov_ivan

The Better Music Producer

Oct 31st, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.54 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Globalization;
  8.  
  9. namespace TheBetterProducer
  10.     {
  11.     class TheBetterProducer
  12.         {
  13.         static void Main()
  14.             {
  15.             //Culture
  16.             Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
  17.             //Const
  18.             const decimal euro = 1.94M;
  19.             const decimal dollar = 1.72M;
  20.             const decimal pesos = 332.74M;
  21.             //input data
  22.             uint numberAlbumsEU = uint.Parse(Console.ReadLine());
  23.             decimal priceEU = decimal.Parse(Console.ReadLine());
  24.             uint numberAlbumsNA = uint.Parse(Console.ReadLine());
  25.             decimal priceDoll = decimal.Parse(Console.ReadLine());
  26.             uint numberAlbumsSA = uint.Parse(Console.ReadLine());
  27.             decimal pricePesos = decimal.Parse(Console.ReadLine());
  28.             uint numberConcerts = uint.Parse(Console.ReadLine());
  29.             decimal profitForSingleCon = decimal.Parse(Console.ReadLine());
  30.             //Calculation
  31.             decimal priceEULv = (numberAlbumsEU * priceEU) * euro;
  32.             decimal priceNALv = (numberAlbumsNA * priceDoll) * dollar;
  33.             decimal priceSALv = (numberAlbumsSA * pricePesos) / pesos;
  34.             decimal albumProfit = priceEULv + priceNALv + priceSALv;
  35.             decimal producerShare = albumProfit * 0.35M;
  36.             decimal profitAfterPrSh = albumProfit - producerShare;
  37.             decimal taxes = profitAfterPrSh * 0.20M;
  38.             decimal profitAfterCharges = albumProfit - (producerShare + taxes);
  39.             decimal concertsProfit = (numberConcerts * profitForSingleCon) * euro;
  40.             //Conditions
  41.             if (profitAfterCharges > concertsProfit)
  42.                 {
  43.                 Console.WriteLine($"Let's record some songs! They'll bring us {profitAfterCharges:F2}lv.");
  44.                 }
  45.             else
  46.                 {
  47.                 if (concertsProfit >= 100000)
  48.                     {
  49.                     decimal charges = concertsProfit * 0.15M;
  50.                     concertsProfit -= charges;
  51.                     Console.WriteLine($"On the road again! We'll see the world and earn {concertsProfit:F2}lv.");
  52.                     }
  53.                 else
  54.                     {
  55.                     Console.WriteLine($"On the road again! We'll see the world and earn {concertsProfit:F2}lv.");
  56.                     }
  57.  
  58.                 }
  59.             }
  60.         }
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement