Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SushiTime
- {
- class Program
- {
- static void Main(string[] args)
- {
- string sushiType = Console.ReadLine();
- string restaurantName = Console.ReadLine();
- int portionsNumber = int.Parse(Console.ReadLine());
- char delivery = char.Parse(Console.ReadLine());
- double price = 0;
- double totalPrice = 0;
- switch (restaurantName)
- {
- case "Sushi Zone":
- if (sushiType == "sashimi")
- {
- price = portionsNumber * 4.99;
- }
- else if (sushiType == "maki")
- {
- price = portionsNumber * 5.29;
- }
- else if (sushiType == "uramaki")
- {
- price = portionsNumber * 5.99;
- }
- else if (sushiType == "temaki")
- {
- price = portionsNumber * 4.29;
- }
- break;
- case "Sushi Time":
- if (sushiType == "sashimi")
- {
- price = portionsNumber * 5.49;
- }
- else if (sushiType == "maki")
- {
- price = portionsNumber * 4.69;
- }
- else if (sushiType == "uramaki")
- {
- price = portionsNumber * 4.49;
- }
- else if (sushiType == "temaki")
- {
- price = portionsNumber * 5.19;
- }
- break;
- case "Sushi Bar":
- if (sushiType == "sashimi")
- {
- price = portionsNumber * 5.25;
- }
- else if (sushiType == "maki")
- {
- price = portionsNumber * 5.55;
- }
- else if (sushiType == "uramaki")
- {
- price = portionsNumber * 6.25;
- }
- else if (sushiType == "temaki")
- {
- price = portionsNumber * 4.75;
- }
- break;
- case "Asian Pub":
- if (sushiType == "sashimi")
- {
- price = portionsNumber * 4.50;
- }
- else if (sushiType == "maki")
- {
- price = portionsNumber * 4.80;
- }
- else if (sushiType == "uramaki")
- {
- price = portionsNumber * 5.50;
- }
- else if (sushiType == "temaki")
- {
- price = portionsNumber * 5.50;
- }
- break;
- default:
- Console.WriteLine($"{restaurantName} is invalid restaurant!");
- return;
- }
- if (delivery == 'Y')
- {
- totalPrice = Math.Ceiling(price * 1.20);
- }
- else if (delivery == 'N')
- {
- totalPrice = Math.Ceiling(price);
- }
- Console.WriteLine($"Total price: {totalPrice} lv.");
- }
- }
- }
Add Comment
Please, Sign In to add comment