Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GroceryStore {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double vegPrice= Double.parseDouble(scanner.nextLine());
- double fruitPrice= Double.parseDouble(scanner.nextLine());
- int vegPerKg = Integer.parseInt(scanner.nextLine());
- int fruitsPerKg= Integer.parseInt(scanner.nextLine());
- double vegTotal = vegPrice * vegPerKg;
- double fruitTotal = fruitPrice * fruitsPerKg;
- System.out.println((fruitTotal + vegTotal) / 1.94);
- }
- }
Add Comment
Please, Sign In to add comment