Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace New_Home
- {
- class Program
- {
- static void Main(string[] args)
- {
- string typeFlower = Console.ReadLine();
- double countOfFlowers = double.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double totalCost = 0;
- double discount = 0;
- double expensive = 0;
- if (typeFlower == "Roses")
- {
- totalCost = countOfFlowers * 5;
- if (countOfFlowers > 80)
- {
- discount = totalCost * 0.1;
- totalCost = totalCost - discount;
- }
- }
- else if (typeFlower == "Dahlias")
- {
- totalCost = countOfFlowers * 3.8;
- if (countOfFlowers > 90)
- {
- discount = totalCost * 0.15;
- totalCost = totalCost - discount;
- }
- }
- else if (typeFlower == "Tulips")
- {
- totalCost = countOfFlowers * 2.8;
- if (countOfFlowers > 80)
- {
- discount = totalCost * 0.15;
- totalCost = totalCost - discount;
- }
- }
- else if (typeFlower == "Narcissus")
- {
- totalCost = countOfFlowers * 3;
- if (countOfFlowers < 120)
- {
- expensive = totalCost * 0.15;
- totalCost = totalCost + expensive;
- }
- }
- else if (typeFlower == "Gladiolus")
- {
- totalCost = countOfFlowers * 2.5;
- if (countOfFlowers < 80)
- {
- expensive = totalCost * 0.2;
- totalCost = totalCost + expensive;
- }
- }
- if (budget >= totalCost)
- {
- Console.WriteLine($"Hey, you have a great garden with {countOfFlowers} {typeFlower} and {budget-totalCost:f2} leva left.");
- }
- else if (budget < totalCost)
- {
- Console.WriteLine($"Not enough money, you need {totalCost-budget:f2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement