Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string flowersType = Console.ReadLine();
- int flowersCount = int.Parse(Console.ReadLine());
- int budget = int.Parse(Console.ReadLine());
- double price = 0.00;
- if (flowersType== "Roses")
- {
- //"Roses" = 5.00 => > 80 - 10 % отстъпка
- price = flowersCount * 5.00;
- if (flowersCount > 80)
- {
- price = price - price * 0.10;
- }
- }
- else if(flowersType == "Dahlias")
- {
- //"Dahlias"=3.80, => >90 - 15% отстъпка
- price = flowersCount * 3.80;
- if (flowersCount > 90)
- {
- price = price - price * 0.15;
- }
- }
- else if (flowersType == "Tulips")
- {
- //"Tulips"=2.80, => >80 - 15% отстъпка
- price = flowersCount * 2.80;
- if (flowersCount > 80)
- {
- price = price - price * 0.15;
- }
- }
- else if (flowersType == "Narcissus")
- {
- //"Narcissus"=3.00, => <120 оскъпява с 15%
- price = flowersCount * 3.00;
- if (flowersCount < 120)
- {
- price = price + price * 0.15;
- }
- }
- else if (flowersType == "Gladiolus")
- {
- //"Gladiolus"=2.50 => <80 оскъпява с 20%
- price = flowersCount * 2.50;
- if (flowersCount < 80)
- {
- price = price + price * 0.20;
- }
- }
- if (budget < price)
- {
- Console.WriteLine($"Not enough money, you need {(price-budget):F2} leva more.");
- }
- else
- {
- Console.WriteLine($"Hey, you have a great garden with {flowersCount} {flowersType} and {(budget-price):F2} leva left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement