Advertisement
YavorGrancharov

VegetableMarket

Dec 29th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.math.BigDecimal;
  2. import java.util.Scanner;
  3. public class VegetableMarket {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.         double vegPrice = Double.parseDouble(console.nextLine());
  7.         double fruitPrice = Double.parseDouble(console.nextLine());
  8.         int kgVegAll = Integer.parseInt(console.nextLine());
  9.         int kgFruitAll = Integer.parseInt(console.nextLine());
  10.         double price = ((vegPrice * kgVegAll) + (fruitPrice * kgFruitAll)) / 1.94;
  11.         BigDecimal euroPrice = new BigDecimal(price);
  12.         System.out.println(euroPrice);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement