SUni2020

Зеленчуковаборса

Mar 23rd, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GroceryStore {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double vegPrice= Double.parseDouble(scanner.nextLine());
  8. double fruitPrice= Double.parseDouble(scanner.nextLine());
  9. int vegPerKg = Integer.parseInt(scanner.nextLine());
  10. int fruitsPerKg= Integer.parseInt(scanner.nextLine());
  11.  
  12. double vegTotal = vegPrice * vegPerKg;
  13. double fruitTotal = fruitPrice * fruitsPerKg;
  14.  
  15. System.out.println((fruitTotal + vegTotal) / 1.94);
  16.  
  17.  
  18. }
  19. }
Add Comment
Please, Sign In to add comment