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