Advertisement
YoannaSt173

zelborsa

Jan 20th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. package yoyo;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class zelborsa {
  6.    
  7.    
  8.    
  9.     public static void main(String[] args){
  10.        
  11.         Scanner scan = new Scanner(System.in);
  12.       //cena
  13.         double vegPrice = Double.parseDouble(scan.nextLine());
  14.         double fruitsPrice = Double.parseDouble(scan.nextLine());
  15.       //kg
  16.         int vegPerKg = Integer.parseInt(scan.nextLine());
  17.         int fruitsPerKg = Integer.parseInt(scan.nextLine());
  18.       //kraina cena
  19.         double vegTotal = vegPrice * vegPerKg;
  20.         double fruitTotal = fruitsPrice * fruitsPerKg;
  21.  
  22.         System.out.println((fruitTotal + vegTotal) / 1.94);
  23.       }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement