Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.NewHouse
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string flowersS = Console.ReadLine();
- int countOfFlowersS = int.Parse(Console.ReadLine());
- int budgetT = int.Parse(Console.ReadLine());
- double price = 0;
- //"Roses", "Dahlias", "Tulips", "Narcissus", "Gladiolus"
- switch (flowersS)
- {
- case "Roses":
- price = 5;
- break;
- case "Dahlias":
- price = 3.80;
- break;
- case "Tulips":
- price = 2.80;
- break;
- case "Narcissus":
- price = 3;
- break;
- case "Gladiolus":
- price = 2.50;
- break;
- }
- double finalPrice = countOfFlowersS * price;
- if (flowersS == "Roses" && countOfFlowersS > 80)
- {
- finalPrice *= 0.9;
- }
- else if (flowersS == "Dahlias" && countOfFlowersS > 90)
- {
- finalPrice *= 0.85;
- }
- else if (flowersS == "Tulips" && countOfFlowersS > 80)
- {
- finalPrice *= 0.85;
- }
- else if (flowersS == "Narcissus" && countOfFlowersS < 120)
- {
- finalPrice *= 1.15;
- }
- else if (flowersS == "Gladiolus" && countOfFlowersS < 80)
- {
- finalPrice *= 1.2;
- }
- double difference = Math.Abs(finalPrice - budgetT);
- if (budgetT >= finalPrice)
- {
- Console.WriteLine($"Hey, you have a great garden with {countOfFlowersS} {flowersS} and {difference:F2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money, you need {difference:F2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement