Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TestApps
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hrizantema = int.Parse(Console.ReadLine());
- int roses = int.Parse(Console.ReadLine());
- int tulips = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string isWeekDay = Console.ReadLine();
- int totalFlowers = hrizantema + roses + tulips;
- double totalHrizantema = 0;
- double totalRoses = 0;
- double totalTulips = 0;
- double totalSum = 0;
- if ((season == "Spring") || (season == "Summer"))
- {
- totalHrizantema += (hrizantema * 2.00);
- totalRoses += (roses * 4.10);
- totalTulips += (tulips * 2.50);
- totalSum = (totalHrizantema + totalRoses + totalTulips);
- if (isWeekDay == "Y")
- {
- totalSum *= 1.15;
- }
- if (season == "Spring" && tulips > 7)
- {
- totalSum *= 0.95;
- }
- if (totalFlowers > 20)
- {
- totalSum *= 0.80;
- }
- totalSum += 2;
- }
- else if ((season == "Autumn") || (season == "Winter"))
- {
- totalHrizantema += (hrizantema * 3.75);
- totalTulips += (tulips * 4.5);
- totalRoses += (roses * 4.15);
- totalSum = (totalHrizantema + totalTulips + totalRoses);
- if (isWeekDay == "Y")
- {
- totalSum *= 1.15;
- }
- if (season == "Winter" && roses >= 10)
- {
- totalSum *= 0.90;
- }
- if (totalFlowers > 20)
- {
- totalSum *= 0.80;
- }
- totalSum += 2;
- }
- Console.WriteLine($"{totalSum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement