Advertisement
Guest User

C# Alc

a guest
May 9th, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var WhiskeyPrice = double.Parse(Console.ReadLine());
  14.             var BeerLitre = double.Parse(Console.ReadLine());
  15.             var WineLitre = double.Parse(Console.ReadLine());
  16.             var RakiaLitre = double.Parse(Console.ReadLine());
  17.             var WhiskeyLitre = double.Parse(Console.ReadLine());
  18.             var RakiaPrice = WhiskeyPrice / 2;
  19.             var WinePrice = RakiaPrice - (0.4 * RakiaPrice);
  20.             var BeerPrice = RakiaPrice - (0.8 * RakiaPrice);
  21.             var WhiskeySum = WhiskeyLitre * WhiskeyPrice;
  22.             var RakiaSum = RakiaPrice * RakiaLitre;
  23.             var WineSum = WinePrice * WineLitre;
  24.             var BeerSum = BeerPrice * BeerLitre;
  25.             var Cash = WhiskeySum + RakiaSum + WineSum + BeerSum;
  26.  
  27.             Console.WriteLine($"{Cash:f2}");
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement