Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TaxCalculator
- {
- class Program
- {
- static void Main(string[] args)
- {
- double buget = double.Parse(Console.ReadLine());
- string text = Console.ReadLine();
- double price = 0;
- double moneyLeft = 0;
- while (text == "Finish")
- {
- if (text == "Star")
- {
- price = 5.69;
- }
- else if (text == "Angel")
- {
- price = 8.49;
- }
- else if (text == "Lights")
- {
- price = 11.20;
- }
- else if (text == "Wreath")
- {
- price = 15.50;
- }
- else if (text == "Candle")
- {
- price = 3.59;
- }
- text = Console.ReadLine();
- if (text == "Finish")
- {
- Console.WriteLine("Congratulations! You bought everything!");
- }
- else
- {
- moneyLeft = price - buget;
- Console.WriteLine($"Not enough money! You need {moneyLeft}lv more.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement