Advertisement
mahitsy

Shops

Jan 19th, 2017
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.07 KB | None | 0 0
  1. package my.company;
  2.  
  3. import com.sun.corba.se.impl.interceptors.PICurrent;
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class Main {
  8.  
  9.     public static void main(String[] args) {
  10.         Scanner scanner = new Scanner(System.in);
  11.  
  12.         String town = scanner.nextLine().toLowerCase();
  13.         String product = scanner.nextLine().toLowerCase();
  14.         double quantily =Double.parseDouble(scanner.nextLine());
  15.  
  16.         if (town.equals("sofia")) {
  17.             if(product.equals("coffee")){
  18.                 System.out.println(quantily*0.50);
  19.             } else if(product.equals("water")) {
  20.                 System.out.println(quantily*0.80);
  21.             } else if (product.equals("beer")){
  22.                 System.out.println(quantily*1.20);
  23.             } else if (product.equals("sweets")){
  24.                 System.out.println(quantily*1.45);
  25.             }else if (product.equals("peanuts")){
  26.                 System.out.println(quantily*1.60);
  27.             }
  28.         }
  29.         if (town.equals("plovdiv")) {
  30.             if(product.equals("coffee")){
  31.                 System.out.println(quantily*0.40);
  32.             } else if(product.equals("water")) {
  33.                 System.out.println(quantily*0.70);
  34.             } else if (product.equals("beer")){
  35.                 System.out.println(quantily*1.15);
  36.             } else if (product.equals("sweets")){
  37.                 System.out.println(quantily*1.30);
  38.             }else if (product.equals("peanuts")){
  39.                 System.out.println(quantily*1.50);
  40.             }
  41.         }if (town.equals("varna")) {
  42.             if(product.equals("coffee")){
  43.                 System.out.println(quantily*0.45);
  44.             } else if(product.equals("water")) {
  45.                 System.out.println(quantily*0.70);
  46.             } else if (product.equals("beer")){
  47.                 System.out.println(quantily*1.10);
  48.             } else if (product.equals("sweets")){
  49.                 System.out.println(quantily*1.35);
  50.             }else if (product.equals("peanuts")){
  51.                 System.out.println(quantily*1.50);
  52.             }
  53.  
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement