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 _03.Sushi_Time
- {
- class Program
- {
- static void Main(string[] args)
- {
- string typeSushi = Console.ReadLine();
- string restorant = Console.ReadLine();
- int quantity = int.Parse(Console.ReadLine());
- string delivery = Console.ReadLine();
- double sum = 0;
- double sashimi = 0;
- double maki = 0;
- double uramaki = 0;
- double temaki = 0;
- //"sashimi", "maki", "uramaki", "temaki"
- // "Sushi Zone", "Sushi Time", "Sushi Bar", "Asian Pub"
- switch (restorant)
- {
- case "Sushi Zone":
- sashimi = 4.99;
- maki = 5.29;
- uramaki = 5.99;
- temaki = 4.29;
- break;
- case "Sushi Time":
- sashimi = 5.49;
- maki = 4.69;
- uramaki = 4.49;
- temaki = 5.19;
- break;
- case "Sushi Bar":
- sashimi = 5.25;
- maki = 5.55;
- uramaki = 6.25;
- temaki = 4.75;
- break;
- case "Asian Pub":
- sashimi = 4.50;
- maki = 4.80;
- uramaki = 5.50;
- temaki = 5.50;
- break;
- //default:
- // Console.WriteLine($"{restorant} is invalid restaurant");
- // break;
- }
- switch (typeSushi)
- {
- case "sashimi":
- sum = sashimi * quantity;
- break;
- case "maki":
- sum = maki * quantity;
- break;
- case "uramaki":
- sum = uramaki * quantity;
- break;
- case "temaki":
- sum = temaki * quantity;
- break;
- //default:
- // Console.WriteLine("Invalid stock!");
- // break;
- }
- //"Sushi Zone", "Sushi Time", "Sushi Bar", "Asian Pub"
- if ((restorant != "Sushi Zone") && (restorant != "Sushi Time") && (restorant != "Sushi Bar") && (restorant != "Asian Pub"))
- {
- Console.WriteLine($"{restorant} is invalid restaurant!");
- }
- else if (delivery == "Y")
- {
- double moneyDelivery = sum * 0.2;
- double allMoney = sum + moneyDelivery;
- Console.WriteLine($"Total price: {Math.Ceiling(allMoney)} lv.");
- }
- else if (delivery == "N")
- {
- Console.WriteLine($"Total price: {Math.Ceiling(sum)} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement