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 ConsoleApplication8
- {
- class Program
- {
- static void Main(string[] args)
- {
- var fruit = Console.ReadLine().ToLower();
- var dayOfWeek = Console.ReadLine().ToLower();
- var quantity = double.Parse(Console.ReadLine());
- if (dayOfWeek == "monday" || dayOfWeek == "tuesday" || dayOfWeek == "wednesday" || dayOfWeek == "thursday" || dayOfWeek == "friday")
- {
- if (fruit == "banana")
- {
- Console.WriteLine(Math.Round(quantity * 2.5 , 2));
- }
- else if (fruit == "apple")
- {
- Console.WriteLine(Math.Round(quantity * 1.2 , 2));
- }
- else if (fruit == "orange")
- {
- Console.WriteLine(Math.Round(quantity * 0.85 , 2));
- }
- else if (fruit == "grapefruit")
- {
- Console.WriteLine(Math.Round(quantity * 1.45 , 2));
- }
- else if (fruit == "kiwi")
- {
- Console.WriteLine(Math.Round(quantity * 2.7 , 2));
- }
- else if (fruit == "pineapple")
- {
- Console.WriteLine(Math.Round(quantity * 5.5 , 2));
- }
- else if (fruit == "grapes")
- {
- Console.WriteLine(Math.Round(quantity * 3.85 , 2));
- }
- }
- else if (dayOfWeek == "saturday" || dayOfWeek == "sunday")
- {
- if (fruit == "banana")
- {
- Console.WriteLine(Math.Round(quantity * 2.7 , 2));
- }
- else if (fruit == "apple")
- {
- Console.WriteLine(Math.Round(quantity * 1.25 , 2));
- }
- else if (fruit == "orange")
- {
- Console.WriteLine(Math.Round(quantity * 0.9 , 2));
- }
- else if (fruit == "grapefruit")
- {
- Console.WriteLine(Math.Round(quantity * 1.6 , 2));
- }
- else if (fruit == "kiwi")
- {
- Console.WriteLine(Math.Round(quantity * 3.00 , 2));
- }
- else if (fruit == "pineapple")
- {
- Console.WriteLine(Math.Round(quantity * 5.6 , 2));
- }
- else if (fruit == "grapes")
- {
- Console.WriteLine(Math.Round(quantity * 4.2 , 2));
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement