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