Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package my.company;
- import com.sun.corba.se.impl.interceptors.PICurrent;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String town = scanner.nextLine().toLowerCase();
- String product = scanner.nextLine().toLowerCase();
- double quantily =Double.parseDouble(scanner.nextLine());
- if (town.equals("sofia")) {
- if(product.equals("coffee")){
- System.out.println(quantily*0.50);
- } else if(product.equals("water")) {
- System.out.println(quantily*0.80);
- } else if (product.equals("beer")){
- System.out.println(quantily*1.20);
- } else if (product.equals("sweets")){
- System.out.println(quantily*1.45);
- }else if (product.equals("peanuts")){
- System.out.println(quantily*1.60);
- }
- }
- if (town.equals("plovdiv")) {
- if(product.equals("coffee")){
- System.out.println(quantily*0.40);
- } else if(product.equals("water")) {
- System.out.println(quantily*0.70);
- } else if (product.equals("beer")){
- System.out.println(quantily*1.15);
- } else if (product.equals("sweets")){
- System.out.println(quantily*1.30);
- }else if (product.equals("peanuts")){
- System.out.println(quantily*1.50);
- }
- }if (town.equals("varna")) {
- if(product.equals("coffee")){
- System.out.println(quantily*0.45);
- } else if(product.equals("water")) {
- System.out.println(quantily*0.70);
- } else if (product.equals("beer")){
- System.out.println(quantily*1.10);
- } else if (product.equals("sweets")){
- System.out.println(quantily*1.35);
- }else if (product.equals("peanuts")){
- System.out.println(quantily*1.50);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement