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 _1.Обръщение_според_възраст_и_пол
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine().ToLower();
- string dayOfWeek = Console.ReadLine().ToLower();
- double quantity = double.Parse(Console.ReadLine());
- double value = 0.0;
- if (dayOfWeek == "monday" || dayOfWeek == "tuesday" || dayOfWeek == "wednesday" || dayOfWeek == "thursday" || dayOfWeek == "friday")
- {
- if (fruit == "banana")
- {
- value = quantity * 2.50;
- }
- else if (fruit == "apple")
- {
- value = quantity * 1.20;
- }
- else if (fruit == "orange")
- {
- value = quantity * 0.85;
- }
- else if (fruit == "grapefruit")
- {
- value = quantity * 1.45;
- }
- else if (fruit == "kiwi")
- {
- value = quantity * 2.70;
- }
- else if (fruit == "pineapple")
- {
- value = quantity * 5.50;
- }
- else if (fruit == "grapes")
- {
- value = quantity * 3.85;
- }
- //else
- //{
- // Console.WriteLine("error");
- //}
- }
- else if (dayOfWeek == "saturday" || dayOfWeek == "sunday")
- {
- if (fruit == "banana")
- {
- value = quantity * 2.70;
- }
- else if (fruit == "apple")
- {
- value = quantity * 1.25;
- }
- else if (fruit == "orange")
- {
- value = quantity * 0.90;
- }
- else if (fruit == "grapefruit")
- {
- value = quantity * 1.60;
- }
- else if (fruit == "kiwi")
- {
- value = quantity * 3.0;
- }
- else if (fruit == "pineapple")
- {
- value = quantity * 5.60;
- }
- else if (fruit == "grapes")
- {
- value = quantity * 4.20;
- }
- //else
- //{
- // Console.WriteLine("error");
- //}
- }
- if (value >0)
- {
- Console.WriteLine($"{value:F2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- //Console.WriteLine($"{value:F2}");
- //double age = double.Parse(Console.ReadLine());
- //string gender = Console.ReadLine();
- //
- //if ( gender == "m")
- //{
- // if (age >= 16)
- // {
- // Console.WriteLine("Mr.");
- // }
- // else
- // {
- // Console.WriteLine("Master");
- // }
- //
- //}
- //else if (gender == "f")
- //{
- // if ( age >= 16)
- // {
- // Console.WriteLine("Ms.");
- // }
- // else
- // {
- // Console.WriteLine("Miss");
- // }
- //
- //}
- //else
- //{
- // Console.WriteLine("Няма такъв пол или е новия пол Джендър");
- //}
- //
- //
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment