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