Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class VegetableMarket {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double vegetablesBg = Double.parseDouble(scanner.nextLine());
- double fruitsBg = Double.parseDouble(scanner.nextLine());
- double vegetablesKg = Double.parseDouble(scanner.nextLine());
- double fruitsKg = Double.parseDouble(scanner.nextLine());
- double result =(((vegetablesBg * vegetablesKg) + (fruitsBg * fruitsKg)) / 1.94);
- System.out.printf("%.2f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement