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 New_House
- {
- class Program
- {
- static void Main(string[] args)
- {
- string flowersType = Console.ReadLine();
- int flowersNum = int.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double sumForFlowers = 0;
- if (flowersType == "Roses")
- {
- sumForFlowers = flowersNum * 5;
- if (flowersNum >= 80)
- {
- sumForFlowers = sumForFlowers - (sumForFlowers * 0.1);
- }
- }
- if (flowersType== "Tulips")
- {
- sumForFlowers = sumForFlowers * 2.80;
- if (flowersNum>=80)
- {
- sumForFlowers = sumForFlowers - sumForFlowers * 0.15;
- }
- else
- {
- sumForFlowers = sumForFlowers*1;
- }
- }
- if (budget > sumForFlowers)
- {
- Console.WriteLine($"Hey, you have a great garden with {flowersNum} {flowersType} and {budget - sumForFlowers:F2} leva left.");
- }
- else if (budget < sumForFlowers)
- {
- Console.WriteLine($"Not enough money, you need {sumForFlowers - budget:F2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement