Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Fishland {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double mackerelPrice = Double.parseDouble(scanner.nextLine());
- double spratPrice = Double.parseDouble(scanner.nextLine());
- double bonitoFishKg = Double.parseDouble(scanner.nextLine());
- double saffronKg = Double.parseDouble(scanner.nextLine());
- double shellKg = Double.parseDouble(scanner.nextLine());
- double bonitoFishSum = bonitoFishKg * mackerelPrice * 1.60;
- double saffronSum = saffronKg * spratPrice * 1.80;
- double shellSum = shellKg * 7.50;
- double sum = bonitoFishSum + saffronSum + shellSum;
- System.out.printf("%.2f", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement