Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practicing
- {
- class Program
- {
- static void Main(string[] args)
- {
- var whiskeyPrice = double.Parse(Console.ReadLine());
- var beer = double.Parse(Console.ReadLine());
- var wine = double.Parse(Console.ReadLine());
- var rakia = double.Parse(Console.ReadLine());
- var whiskey = double.Parse(Console.ReadLine());
- double rakiaPrice = whiskeyPrice / 2;
- double winePrice = 0.6 * rakiaPrice; winePrice *= wine;
- double beerPrice = 0.2 * rakiaPrice; beerPrice *= beer;
- whiskeyPrice *= whiskey;
- rakiaPrice *= rakia;
- double price = rakiaPrice +
- winePrice + beerPrice + whiskeyPrice;
- Console.WriteLine($"{price:f2}");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment