Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp4
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //INPUT
- string team = Console.ReadLine();
- string typeSouvenirs = Console.ReadLine();
- int numberBoughtSouvenirs = int.Parse(Console.ReadLine());
- double price = 0;
- //CALCULATIONS
- //Argentina
- if (team == "Argentina")
- {
- if (typeSouvenirs == "flags")
- {
- price = 3.25;
- }
- else if (typeSouvenirs == "caps")
- {
- price = 7.20;
- }
- else if (typeSouvenirs == "posters")
- {
- price = 5.10;
- }
- else if (typeSouvenirs == "stickers")
- {
- price = 1.25;
- }
- }
- //Brasil
- else if (team == "Brazil")
- {
- if (typeSouvenirs == "flags")
- {
- price = 4.20;
- }
- else if (typeSouvenirs == "caps")
- {
- price = 8.50;
- }
- else if (typeSouvenirs == "posters")
- {
- price = 5.35;
- }
- else if (typeSouvenirs == "stickers")
- {
- price = 1.20;
- }
- }
- //Croatia
- else if (team == "Croatia")
- {
- if (typeSouvenirs == "flags")
- {
- price = 2.75;
- }
- else if (typeSouvenirs == "caps")
- {
- price = 6.90;
- }
- else if (typeSouvenirs == "posters")
- {
- price = 4.95;
- }
- else if (typeSouvenirs == "stickers")
- {
- price = 1.10;
- }
- }
- //Denmark
- else if (team == "Denmark")
- {
- if (typeSouvenirs == "flags")
- {
- price = 3.10;
- }
- else if (typeSouvenirs == "caps")
- {
- price = 6.50;
- }
- else if (typeSouvenirs == "posters")
- {
- price = 4.80;
- }
- else if (typeSouvenirs == "stickers")
- {
- price = 0.90;
- }
- }
- double sum = numberBoughtSouvenirs * price;
- //OUTPUT
- if (team != "Argentina" && team != "Brazil" && team != "Croatia" && team != "Denmark")
- {
- Console.WriteLine("Invalid country!");
- return;
- }
- if (typeSouvenirs != "caps" && typeSouvenirs != "flags" && typeSouvenirs != "posters" && typeSouvenirs != "stickers")
- {
- Console.WriteLine($"Invalid stock!");
- return;
- }
- else
- {
- Console.WriteLine($"Pepi bought {numberBoughtSouvenirs} {typeSouvenirs} of {team} for {sum:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement