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 console = new Scanner(System.in);
- double mackerelPrice= Double.parseDouble(console.nextLine());
- double spratPrice= Double.parseDouble(console.nextLine());
- double kilosBeltedBonito= Double.parseDouble(console.nextLine());
- double kilosScad= Double.parseDouble(console.nextLine());
- double kilosClams= Double.parseDouble(console.nextLine());
- double beltedBonitoPricePerKilo = mackerelPrice + (mackerelPrice * 0.60);
- double scadPricePerKilo = spratPrice + ( spratPrice * 0.80);
- double clamsPricePerKilo = 7.50;
- double georgesBonitos = kilosBeltedBonito * beltedBonitoPricePerKilo;
- double georgesScad = kilosScad * scadPricePerKilo;
- double georgesClams = kilosClams * clamsPricePerKilo;
- double grandTotal = georgesBonitos + georgesClams + georgesScad;
- System.out.printf("%.2f", grandTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment