Advertisement
Boyan5

Untitled

Jun 8th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. package vegemarket;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class vege {
  6.  
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. double VegetablePrice = Double.parseDouble(scanner.nextLine());
  11. double FruitPrice = Double.parseDouble(scanner.nextLine());
  12. int VegetablePerKg = scanner.nextInt();
  13. int FruitPerKg = scanner.nextInt();
  14.  
  15. double vegetableTotal = VegetablePrice * VegetablePerKg;
  16. double fruitTotal = FruitPrice * FruitPerKg;
  17.  
  18. System.out.println("Total = " + (vegetableTotal + fruitTotal) / 1.94);
  19. }
  20.  
  21.  
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement