Advertisement
Guest User

Untitled

a guest
Apr 18th, 2017
167
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.util.Scanner;
  2.  
  3. public class Ex02VegetablesMarket {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double priceVegetables = Double.parseDouble(scanner.nextLine());
  7.         double priceFruits = Double.parseDouble(scanner.nextLine());
  8.         int weightVegetables = Integer.parseInt(scanner.nextLine());
  9.         int weightFruits = Integer.parseInt(scanner.nextLine());
  10.         double rateEUR = 1.94d;
  11.         double profit = (priceVegetables*(double)weightVegetables + priceFruits*(double)weightFruits)/rateEUR;
  12.         System.out.printf("%f", profit);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement