Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
2.5 kB
1
Indexable
Never
import java.util.Scanner;

public class FootballSouvenirs {
    public static void main(String[] args) {

       Scanner scanner = new Scanner(System.in);


       String team = scanner.nextLine();
       String kindofsouvenirs= scanner.nextLine();
         int numberofbuy= Integer.parseInt(scanner.nextLine());


      double price = 0;

        switch (team) {
            case "Argentina":
                if (kindofsouvenirs.equals("flags")) {
                    price += 3.25;
                } else if (kindofsouvenirs.equals("caps")) {
                    price += 7.20;
                } else if (kindofsouvenirs.equals("posters")) {
                    price += 5.10;
                }else if (kindofsouvenirs.equals("stickers"))
                {
                    price +=1.25;
                }
                break;

            case "Brazil":
                if (kindofsouvenirs.equals("flags")) {
                    price += 4.20;
                } else if (kindofsouvenirs.equals("caps")) {
                    price += 8.50;
                } else if (kindofsouvenirs.equals("posters")){
                    price += 5.35;
                }
                else if (kindofsouvenirs.equals("stickers")){
                    price +=1.20;
                }
                break;

            case "Croatia":
           if (kindofsouvenirs.equals("flags")) {
               price += 2.75;
           }
           else if (kindofsouvenirs.equals("caps")) {

               price += 6.90;
           }
           else if (kindofsouvenirs.equals("posters")){
               price +=4.95 ;}
               else if(kindofsouvenirs.equals("stickers")){
                   price += 1.10;
           }
               break;

            case "Denmark":
                if (kindofsouvenirs.equals("flags")) {
                    price += 3.10;
                }
                else if (kindofsouvenirs.equals("caps")) {
                    price += 6.50;

                }
                else if (kindofsouvenirs.equals("posters")) {
                    price += 4.80;
                }
                else if (kindofsouvenirs.equals("stickers")){
                    price +=0.90;

                }
                break;







        }
        double total = price * numberofbuy ;
        System.out.printf("Pepi bought {%f} {%f} of {%f} for {%f} lv.",numberofbuy ,kindofsouvenirs,team,total);

        }
    }