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)
- {
- string fruits = Console.ReadLine();
- string dayOfWeek = Console.ReadLine().ToLower();
- double quantity = double.Parse(Console.ReadLine());
- double price = -1.0;
- if (dayOfWeek == "monday" || dayOfWeek == "tuesday" || dayOfWeek == "wednesday" || dayOfWeek == "thursday" ||
- dayOfWeek == "friday") ;
- {
- if (fruits == "banana") price = 2.50;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- }
- if (fruits == "apple") price = 1.20;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "orange") price = 0.85;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "grapefruit") price = 1.45;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "kiwi") price = 2.70;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "pineapple") price = 5.50;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "grapes") price = 3.85;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else
- {
- Console.WriteLine("error");
- }
- if (dayOfWeek == "saturday" || dayOfWeek == "sunday") ;
- {
- if (fruits == "banana") price = 2.70;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- }
- if (fruits == "apple") price = 1.25;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "orange") price = 0.90;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "grapefruit") price = 1.60;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "kiwi") price = 3.00;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "pineapple") price = 5.60;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- }
- if (fruits == "grapes") price = 4.20;
- {
- if (price >= 0)
- {
- Console.WriteLine("{0:f2}", price * quantity);
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment