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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string flower = Console.ReadLine();
- int numberFlowers = int.Parse(Console.ReadLine());
- decimal budget = decimal.Parse(Console.ReadLine());
- decimal priceEnd = 0m;
- decimal balance = 0m;
- decimal priceRoses = 5m;
- decimal priceDahlias = 3.80m;
- decimal priceTulips = 2.80m;
- decimal priceNarcissus = 3m;
- decimal priceGladiolus = 2.5m;
- if (numberFlowers>=10 && numberFlowers<=1000
- && budget>=50 && budget<=2500)
- {
- if (flower=="Roses" && numberFlowers>80)
- {
- priceEnd = numberFlowers * priceRoses * 0.9m;
- balance = budget - priceEnd;
- if (balance >= 0)
- {
- Console.WriteLine("Hey, you have a great garden " +
- "with {0} Roses and {1:f2} leva left.",
- numberFlowers,Math.Abs(balance));
- }
- else
- {
- Console.WriteLine("Not enough money, you need " +
- "{0:f2} leva more.", Math.Abs(balance));
- }
- }
- else if (flower=="Roses" && numberFlowers<=80)
- {
- priceEnd = numberFlowers * priceRoses;
- balance = budget - priceEnd;
- if (balance>=0)
- {
- Console.WriteLine("Hey, you have a great garden " +
- "with {0} Roses and {1:f2} leva left.",
- numberFlowers, Math.Abs(balance));
- }
- else
- {
- Console.WriteLine("Not enough money, you need " +
- "{0:f2} leva more.", Math.Abs(balance));
- }
- }
- else if (flower=="Dahlias" && numberFlowers>90)
- {
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement