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