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