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 = string.Empty;
- 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;
- }
- }
- 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;
- }
- }
- 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;
- }
- }
- 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;
- }
- }
- if (order == "Y")
- {
- totalPrice = Math.Ceiling(numberOfPortions * priceforOnePortion) * 1.2;
- }
- else
- {
- totalPrice = Math.Ceiling(numberOfPortions * priceforOnePortion);
- }
- Console.WriteLine($"Total price: {totalPrice}");
- if (restrestaurantName != "Sushi Zone" && restrestaurantName != "Sushi Time" && restrestaurantName != "Sushi Bar" && restrestaurantName != "Asian Pub")
- {
- Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement