SHARE
TWEET

Задача 1.2

NikolayPresolski Dec 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top