Advertisement
Spocoman

06. Fishland

Aug 20th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Fishland {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double mackerelPrice = Double.parseDouble(scanner.nextLine());
  7.         double spratPrice = Double.parseDouble(scanner.nextLine());
  8.         double bonitoFishKg = Double.parseDouble(scanner.nextLine());
  9.         double saffronKg = Double.parseDouble(scanner.nextLine());
  10.         double shellKg = Double.parseDouble(scanner.nextLine());
  11.  
  12.         double bonitoFishSum = bonitoFishKg * mackerelPrice * 1.60;
  13.         double saffronSum = saffronKg * spratPrice * 1.80;
  14.         double shellSum = shellKg * 7.50;
  15.         double sum = bonitoFishSum + saffronSum + shellSum;
  16.        
  17.         System.out.printf("%.2f", sum);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement