Advertisement
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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string drink = Console.ReadLine();
- string sugar = Console.ReadLine();
- int countOfDrinks = int.Parse(Console.ReadLine());
- double price = 0;
- // double totalPrice = 0;
- if (drink == "Espresso")
- {
- if (sugar == "Without")
- {
- price = countOfDrinks * 0.9;
- price = price - price * 0.35;
- }
- else if (sugar == "Normal") price = countOfDrinks * 1;
- else if (sugar == "Extra") price = countOfDrinks * 1.2;
- if (countOfDrinks >= 5) price = price - price * 0.25;
- if (price > 15) price = price - price * 0.2;
- }
- else
- {
- if (drink == "Tea")
- {
- if (sugar == "Without")
- {
- price = countOfDrinks * 0.5;
- price = price - price * 0.35;
- }
- else if (sugar == "Normal") price = countOfDrinks * 0.6;
- else if (sugar == "Extra") price = countOfDrinks * 0.7;
- if (price > 15) price = price - price * 0.2;
- }
- else
- {
- if (drink == "Cappuccino")
- {
- if (sugar == "Without")
- {
- price = countOfDrinks * 1;
- price = price - price * 0.35;
- }
- else if (sugar == "Normal") price = countOfDrinks * 1.2;
- else if (sugar == "Extra") price = countOfDrinks * 1.6;
- if (price > 15) price = price - price * 0.2;
- }
- }
- }
- Console.WriteLine("You bought {0} cups of {1} for {2:F2}lv.", countOfDrinks, drink, price);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement