Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace New_House
- {
- class Program
- {
- static void Main(string[] args)
- {
- string flower = Console.ReadLine();
- double countFlower = double.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double rosesPrice = 5;
- double dahliasPrice = 3.80;
- double tulipsPrice = 2.80;
- double narcissusPrice = 3;
- double gladiolusPrice = 2.50;
- double price = 0;
- if (flower == "Roses")
- {
- if (countFlower > 80)
- {
- double rosesM = countFlower * rosesPrice;
- price = rosesM - (rosesM * 0.1);
- }
- else
- {
- price = countFlower * rosesPrice;
- }
- }
- if (flower=="Dahlias")
- {
- if (countFlower>90)
- {
- double dahliasM = countFlower * dahliasPrice;
- price = dahliasM - (dahliasM * 0.15);
- }
- else
- {
- price = countFlower * dahliasPrice;
- }
- }
- if (flower=="Tulips")
- {
- if (countFlower>80)
- {
- double tulipsM = countFlower * tulipsPrice;
- price = tulipsM - (tulipsM * 0.15);
- }
- else
- {
- price = countFlower * tulipsPrice;
- }
- }
- if (flower=="Narcissus")
- {
- if (countFlower<120)
- {
- double narcM = countFlower * narcissusPrice;
- price = narcM + (narcM * 0.15);
- }
- else
- {
- price = countFlower * narcissusPrice;
- }
- }
- if (flower=="Gladiolus")
- {
- if (countFlower<80)
- {
- double gladiolusM = countFlower * gladiolusPrice;
- price = gladiolusM + (gladiolusM * 0.20);
- }
- else
- {
- price = countFlower * gladiolusPrice;
- }
- }
- if (price>budget)
- {
- Console.WriteLine($"Not enough money, you need {price-budget:F2} leva more.");
- }
- else
- {
- Console.WriteLine($"Hey, you have a great garden with {countFlower} {flower} and {budget-price:F2} leva left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement