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 Fruit_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double weekpricebanana = 2.50d;
- double weekpriceapple = 1.20d;
- double weekpriceorange = 0.85d;
- double weekpricegrapefuit = 1.45d;
- double weekpricekiwi = 2.70d;
- double weekpricepineapple = 5.50d;
- double weekpricegrapes = 3.85d;
- double weekendpricebanana = 2.70d;
- double weekendpriceapple = 1.25d;
- double weekendpriceorange = 0.90d;
- double weekendpricegrapefuit = 1.60d;
- double weekendpricekiwi = 3.00d;
- double weekendpricepineapple = 5.60d;
- double weekendpricegrapes = 4.20d;
- string fruit = Console.ReadLine();
- string day = Console.ReadLine();
- double quantity = double.Parse(Console.ReadLine());
- //banana
- if(fruit=="banana"&&(day=="Monday"||day=="Tuesday"||day=="Wednesday"||day=="Thursday"||day=="Friday"))
- {
- double price = weekpricebanana * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if(fruit == "banana" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpricebanana * quantity;
- Console.WriteLine("{0:f2}",price);
- }
- //apple
- else if (fruit == "apple" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpriceapple * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "apple" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpriceapple * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- //orange
- else if (fruit == "orange" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpriceorange * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "orange" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpriceorange * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- //grapefruit
- else if (fruit == "grapefruit" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpricegrapefuit * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "grapefruit" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpricegrapefuit * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- //kiwi
- else if (fruit == "kiwi" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpricekiwi * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "kiwi" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpricekiwi * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- //pineapple
- else if (fruit == "pineapple" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpricepineapple * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "pineapple" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpricepineapple * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- //grapes
- else if (fruit == "grapes" && (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday"))
- {
- double price = weekpricegrapes * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else if (fruit == "grapes" && (day == "Saturday" || day == "Sunday"))
- {
- double price = weekendpricegrapes * quantity;
- Console.WriteLine("{0:f2}", price);
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment