Advertisement
Guest User

shop(vegatables,fruits)

a guest
Oct 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package adsadsdasd;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class tttttttt {
  6.  
  7. public static void main(String[] args) {
  8.  
  9.  
  10.  
  11. Scanner scan = new Scanner(System.in);
  12.  
  13. System.out.print("VegetablePrice = ");
  14. double VegetablePrice = scan.nextDouble();
  15.  
  16. System.out.print("FruitPrice = ");
  17. double FruitPrice = scan.nextDouble();
  18.  
  19. System.out.print("VegetablePerKg = ");
  20. int VegetablePerKg = scan.nextInt();
  21.  
  22. System.out.print("FruitPerKg = ");
  23. int FruitPerKg = scan.nextInt();
  24.  
  25. double vegetableTotal = VegetablePrice * VegetablePerKg;
  26. double fruitTotal = FruitPrice * FruitPerKg;
  27.  
  28. System.out.println("VegetableTotal = " + vegetableTotal);
  29. System.out.println("FruitTotal = " + fruitTotal);
  30. System.out.println("Total = " + (vegetableTotal + fruitTotal) / 1.94);
  31. }
  32.  
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement