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 FlowerShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- //vhodni danni
- var hrizantemi = int.Parse(Console.ReadLine());
- var rozi = int.Parse(Console.ReadLine());
- var laleta = int.Parse(Console.ReadLine());
- string season = Console.ReadLine().ToLower();
- var isHoliday = Console.ReadLine().ToLower();
- //promenlivi
- double priceHrizSeason=0.00;
- double priceRoziSeason = 0.00;
- double priceLaleSeason = 0.00;
- double holidayPriceHriz = priceHrizSeason + priceHrizSeason * 0.15;
- double holidayPriceRozi = priceRoziSeason + priceRoziSeason * 0.15;
- double holidayPriceLale = priceLaleSeason + priceLaleSeason * 0.15;
- int buntFlower = hrizantemi + rozi + laleta;
- double buntFlowerPrice;
- double PriceWithDiscoun;
- double HolidayPrice;
- //LYATO PROLET
- if (season=="summer" || season == "spring")
- {
- priceHrizSeason = 2.00;
- priceRoziSeason = 4.10;
- priceLaleSeason = 2.50;
- buntFlowerPrice = hrizantemi * priceHrizSeason + laleta * priceLaleSeason + rozi * priceRoziSeason;
- HolidayPrice = buntFlowerPrice + buntFlowerPrice*0.15;
- if (isHoliday == "y")
- {
- if (laleta > 7 && buntFlower < 20)
- {
- PriceWithDiscoun = HolidayPrice- HolidayPrice * 0.05 + 2;
- Console.WriteLine($"{PriceWithDiscoun:f2}");
- }
- else if (buntFlower > 20)
- {
- PriceWithDiscoun = HolidayPrice - HolidayPrice * 0.2;
- Console.WriteLine($"{PriceWithDiscoun:f2}");
- }
- else
- {
- Console.WriteLine(HolidayPrice);
- }
- }
- else if (isHoliday == "n")
- {
- Console.WriteLine(buntFlowerPrice);
- }
- else
- {
- buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
- Console.WriteLine($"{buntFlowerPrice:f2}");
- }
- }
- //ZIMA _ESEN
- if (season == "autumn" || season == "winter")
- {
- priceHrizSeason = 3.75;
- priceRoziSeason = 4.50;
- priceLaleSeason = 4.10;
- holidayPriceHriz = priceHrizSeason + priceHrizSeason * 0.15;
- holidayPriceRozi = priceRoziSeason + priceRoziSeason * 0.15;
- holidayPriceLale = priceLaleSeason + priceLaleSeason * 0.15;
- if (isHoliday == "y")
- {
- buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
- PriceWithDiscoun = buntFlowerPrice + 2;
- if (rozi > 10 && buntFlower < 20)
- {
- buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
- PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.10 + 2;
- Console.WriteLine($"{PriceWithDiscoun:f2}");
- }
- else if (buntFlower > 20)
- {
- buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
- PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.2;
- Console.WriteLine($"{PriceWithDiscoun:f2}");
- }
- else
- {
- buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
- Console.WriteLine($"{buntFlowerPrice:f2}");
- }
- }
- else if (isHoliday == "n")
- {
- if (rozi > 10 && buntFlower < 20)
- {
- buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
- PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.10 + 2;
- Console.WriteLine($"{PriceWithDiscoun:f2}");
- }
- buntFlowerPrice = (hrizantemi * priceHrizSeason + laleta * priceLaleSeason + rozi * priceRoziSeason) + 2;
- }
- }
- }
- //switch (season)
- //{
- // case "Summer" || "Spring" :
- // break;
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement