Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NewHouse
- {
- class Program
- {
- static void Main(string[] args)
- {
- string flowers = Console.ReadLine();
- int countsFlowers = int.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double price = 0;
- double totalPrice = price * countsFlowers;
- switch (flowers)
- {
- case "Roses":
- price = 5.0;
- if ( countsFlowers > 80)
- {
- price *= 0.90;
- }
- break;
- case "Dahlias":
- price = 3.80;
- if (countsFlowers > 90)
- {
- price *= 0.85;
- }
- break;
- case "Tulips":
- price = 2.80;
- if (countsFlowers > 80)
- {
- price *= 0.85;
- }
- break;
- case "Narcissus":
- price = 3.00;
- if (countsFlowers < 120)
- {
- price *= 1.15;
- }
- break;
- case "Gladiolus":
- price = 2.50;
- if (countsFlowers < 80)
- {
- price *= 1.20;
- }
- break;
- }
- if (budget >= totalPrice)
- {
- Console.WriteLine($"Hey, you have a great garden with {countsFlowers} {flowers} and {budget - totalPrice:f2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money, you need {budget - totalPrice:f2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement