Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double strawberriesPrice = Double.parseDouble(scanner.nextLine()),
- bananasKg = Double.parseDouble(scanner.nextLine()),
- orangesKg = Double.parseDouble(scanner.nextLine()),
- raspberriesKg = Double.parseDouble(scanner.nextLine()),
- strawberriesKg = Double.parseDouble(scanner.nextLine()),
- raspberriesPrice = strawberriesPrice / 2,
- orangesPrice = raspberriesPrice * 0.60,
- bananasPrice = raspberriesPrice / 5,
- totalSum = strawberriesPrice * strawberriesKg + bananasPrice * bananasKg
- + orangesPrice * orangesKg + raspberriesPrice * raspberriesKg;
- System.out.printf("%.2f", totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement