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 Flowers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberChrysanthemums = int.Parse(Console.ReadLine());
- int numberRoses = int.Parse(Console.ReadLine());
- int numberTulips = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string holiday = Console.ReadLine();
- double chrysanthemums = 0;
- double roses = 0;
- double tulips = 0;
- double totalFlowers = 0;
- double price = 0;
- totalFlowers = numberTulips + numberRoses + numberChrysanthemums;
- if (season == "Spring" || season == "Summer")
- {
- chrysanthemums = 2.00 * numberChrysanthemums;
- roses = 4.10 * numberRoses;
- tulips = 2.50 * numberTulips;
- }
- else if (season == "Аutumn" || season == "Winter")
- {
- chrysanthemums = 3.75 * numberChrysanthemums;
- roses = 4.50 * numberRoses;
- tulips = 4.15 * numberTulips;
- }
- price = chrysanthemums + roses + tulips;
- if (holiday == "Y")
- {
- price = price + price * 0.15;
- }
- if (season == "Spring" && numberTulips > 7)
- {
- price = price - price * 0.05;
- }
- if (season == "Winter" && numberRoses >= 10)
- {
- price = price - price * 0.10;
- }
- if (totalFlowers >= 20)
- {
- price = price - price * 0.20;
- }
- price = price + 2;
- Console.WriteLine($"{price:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement