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