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 ConsoleApp16
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal cenapizzy = 20m;
- Console.WriteLine("Cena podstawowa pizzy {0}", cenapizzy);
- Console.WriteLine("Wybierz dodatek do pizzy: pomidor/cebula/oliwki");
- string dodatek = Console.ReadLine();
- switch (dodatek)
- {
- case "pomidor":
- cenapizzy = cenapizzy + 5;
- Console.WriteLine("Cena pizzy z dodatkiem to {0}", cenapizzy);
- break;
- case "cebula":
- cenapizzy = cenapizzy + 5;
- Console.WriteLine("Cena pizzy z dodatkiem to {0}", cenapizzy);
- break;
- case "oliwki":
- cenapizzy = cenapizzy + 5;
- Console.WriteLine("Cena pizzy z dodatkiem to {0}", cenapizzy);
- break;
- default:
- Console.WriteLine("Nie ma takiego dodatku");
- break;
- }
- Console.WriteLine("Czy chcesz napój (t/n)");
- char odpowiedz = char.Parse(Console.ReadLine());
- switch (odpowiedz)
- {
- case 't':
- cenapizzy += 3;
- Console.WriteLine("Cena pizzy z napojem to {0}", cenapizzy);
- break;
- case 'n':
- Console.WriteLine("Nie wybrałeś napoju");
- break;
- default:
- Console.WriteLine("Wpisałeś złą literę");
- break;
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement