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 typeOfSushi = Console.ReadLine();
- string restrestaurantName = Console.ReadLine();
- int numberOfPortions = int.Parse(Console.ReadLine());
- string order = Console.ReadLine();
- double priceforOnePortion = 0;
- double totalPrice = 0;
- if (typeOfSushi == "sashimi")
- {
- switch (restrestaurantName)
- {
- case "Sushi Zone":
- priceforOnePortion = 4.99;
- break;
- case "Sushi Time":
- priceforOnePortion = 5.49;
- break;
- case "Sushi Bar":
- priceforOnePortion = 5.25;
- break;
- case "Asian Pub":
- priceforOnePortion = 5.25;
- break;
- default:
- Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
- break;
- }
- }
- else if (typeOfSushi == "maki")
- {
- switch (restrestaurantName)
- {
- case "Sushi Zone":
- priceforOnePortion = 5.29;
- break;
- case "Sushi Time":
- priceforOnePortion = 4.69;
- break;
- case "Sushi Bar":
- priceforOnePortion = 5.55;
- break;
- case "Asian Pub":
- priceforOnePortion = 4.80;
- break;
- default:
- Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
- break;
- }
- }
- else if (typeOfSushi == "uramaki")
- {
- switch (restrestaurantName)
- {
- case "Sushi Zone":
- priceforOnePortion = 5.99;
- break;
- case "Sushi Time":
- priceforOnePortion = 4.49;
- break;
- case "Sushi Bar":
- priceforOnePortion = 6.25;
- break;
- case "Asian Pub":
- priceforOnePortion = 5.50;
- break;
- default:
- Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
- break;
- }
- }
- else if (typeOfSushi == "temaki")
- {
- switch (restrestaurantName)
- {
- case "Sushi Zone":
- priceforOnePortion = 4.29;
- break;
- case "Sushi Time":
- priceforOnePortion = 5.19;
- break;
- case "Sushi Bar":
- priceforOnePortion = 4.75;
- break;
- case "Asian Pub":
- priceforOnePortion = 5.50;
- break;
- default:
- Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
- break;
- }
- }
- double cost = numberOfPortions * priceforOnePortion;
- if (cost != 0)
- {
- if (order == "Y")
- {
- totalPrice = (cost * 1.2);
- Console.WriteLine($"Total price: {Math.Ceiling(totalPrice)} lv.");
- }
- else
- {
- Console.WriteLine($"Total price: {Math.Ceiling(cost)} lv.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement