Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _3
- {
- class Program
- {
- static void Main(string[] args)
- {
- var fruit = Console.ReadLine();
- var size = Console.ReadLine();
- var numberOfSets = int.Parse(Console.ReadLine());
- var priceForSet = 0.0;
- if(fruit == "Watermelon")
- {
- if (size == "small")
- {
- priceForSet = 2 * 56.0;
- }
- else
- {
- priceForSet = 5 * 28.70;
- }
- }
- else if(fruit == "Mango")
- {
- if (size == "small")
- {
- priceForSet = 2 * 36.66;
- }
- else
- {
- priceForSet = 5 * 19.60;
- }
- }
- else if(fruit == "Pineapple")
- {
- if (size == "small")
- {
- priceForSet = 2 * 42.10;
- }
- else
- {
- priceForSet = 5 * 24.80;
- }
- }
- else if(fruit == "Raspberry")
- {
- if (size == "small")
- {
- priceForSet = 2 * 20.0;
- }
- else
- {
- priceForSet = 5 * 15.20;
- }
- }
- var discount = 0.0;
- if(priceForSet * numberOfSets >= 400 && priceForSet * numberOfSets <= 1000)
- {
- discount = 15.0 * priceForSet * numberOfSets / 100.0;
- }
- else if(priceForSet * numberOfSets > 1000)
- {
- discount = priceForSet * numberOfSets / 2.0;
- }
- Console.WriteLine("{0:0.00} lv.", priceForSet * numberOfSets - discount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement