Advertisement
NikolayPresolski

Задача 1.2

Dec 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package Java1program;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ednodwe {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         double vegPrice = Double.parseDouble(scanner.nextLine());
  9.         double fruitsPrice = Double.parseDouble(scanner.nextLine());
  10.         int vegPerKG = Integer.parseInt(scanner.nextLine());
  11.         int fruitPerKG = Integer.parseInt(scanner.nextLine());
  12.         double vegTotal = vegPrice*vegPerKG;
  13.         double fruitsTotal = fruitsPrice*fruitPerKG;
  14.         System.out.println((vegTotal + fruitsTotal) / 1.94);
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement