Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class Program
- {
- static void Main(string[] args)
- {
- string drink = Console.ReadLine();
- string sugar = Console.ReadLine();
- int drinkCount = int.Parse(Console.ReadLine());
- double drinkPrice = 0.0;
- if (drink == "Espresso")
- {
- if (sugar == "Without")
- {
- drinkPrice = 0.90;
- }
- else if(sugar == "Normal")
- {
- drinkPrice = 1.00;
- }
- else
- {
- drinkPrice = 1.20;
- }
- }
- else if (drink == "Cappuccino")
- {
- if (sugar == "Without")
- {
- drinkPrice = 1.0;
- }
- else if (sugar == "Normal")
- {
- drinkPrice = 1.20;
- }
- else
- {
- drinkPrice = 1.60;
- }
- }
- else
- {
- if (sugar == "Without")
- {
- drinkPrice = 0.50;
- }
- else if (sugar == "Normal")
- {
- drinkPrice = 0.60;
- }
- else
- {
- drinkPrice = 0.70;
- }
- }
- double drinkSum = drinkCount * drinkPrice;
- if (sugar == "Without")
- {
- drinkSum *= 0.65;
- }
- if(drink == "Espresso" && drinkCount >= 5)
- {
- drinkSum *= 0.75;
- }
- if (drinkSum > 15)
- {
- drinkSum *= 0.80;
- }
- Console.WriteLine($"You bought {drinkCount} cups of {drink} for {drinkSum:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement