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 Zadachi
- {
- class Program
- {
- static void Main(string[] args)
- {
- string type = Console.ReadLine();
- int flowers = int.Parse(Console.ReadLine());
- int budget = int.Parse(Console.ReadLine());
- double expense = 0;
- if (type == "Roses")
- {
- if (flowers > 80)
- {
- expense = flowers * 5;
- expense = expense - expense * 0.10;
- }
- else
- {
- expense = flowers * 5;
- }
- }
- else if (type == "Dahlias")
- {
- if (flowers > 90)
- {
- expense = flowers * 3.80;
- expense = expense - expense * 0.15;
- }
- else
- {
- expense = flowers * 3.80;
- }
- }
- else if (type == "Tulips")
- {
- if (flowers > 80)
- {
- expense = flowers * 2.80;
- expense = expense - expense * 0.15;
- }
- else
- {
- expense = flowers * 2.80;
- }
- }
- else if (type == "Narcissus")
- {
- if (flowers < 120)
- {
- expense = flowers * 3;
- expense *= 1.5;
- }
- else
- {
- expense = flowers * 3;
- }
- }
- else if (type == "Gladiolus")
- {
- if (flowers < 80)
- {
- expense = flowers * 2.50;
- expense *= 1.2;
- }
- else
- {
- expense = flowers * 2.50;
- }
- }
- if (budget > expense)
- {
- Console.WriteLine($"Hey, you have a great garden with {flowers} {type} and {budget - expense:f2} leva left.");
- }
- else if (budget < expense)
- {
- Console.WriteLine($"Not enough money, you need {expense - budget:f2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement