MladenKarachanov

VegetableMarket

Jan 11th, 2024
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package ProgrammingBasics2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class VegetableMarket {
  6.     public static void main(String[] args) {
  7.         Scanner scanner= new Scanner(System.in);
  8.         double priceVegetable = Double.parseDouble(scanner.nextLine());
  9.         double priceFruit = Double.parseDouble(scanner.nextLine());
  10.         int allVegetable = Integer.parseInt(scanner.nextLine());
  11.         int allFruit = Integer.parseInt(scanner.nextLine());
  12.         double sumVegetable = priceVegetable*allVegetable;
  13.         double sumFruit= priceFruit*allFruit;
  14.         double result= (sumVegetable+sumFruit)/1.94;
  15.         System.out.printf("%.2f",result);
  16.     }
  17. }
  18.  
Add Comment
Please, Sign In to add comment