Advertisement
marinjordanov

FishBazzar

Sep 14th, 2021
14
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class FishBazar {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double pricePerKiloForSkumriq = Double.parseDouble(scanner.nextLine());
  7. double pricePerKiloForCaca = Double.parseDouble(scanner.nextLine());
  8. double kilogramsOfPalamud = Double.parseDouble(scanner.nextLine());
  9. double kilogramsOfSafrid = Double.parseDouble(scanner.nextLine());
  10. int kilogramsOfMidi = Integer.parseInt(scanner.nextLine());
  11. if (0 < pricePerKiloForSkumriq && pricePerKiloForSkumriq <= 40)
  12. if (0 < pricePerKiloForCaca && pricePerKiloForCaca <= 30)
  13. if (0 < kilogramsOfPalamud && kilogramsOfPalamud <= 50)
  14. if (0 < kilogramsOfSafrid && kilogramsOfSafrid <= 70)
  15. if (0 <= kilogramsOfMidi && kilogramsOfMidi <= 100) {
  16. double totalAmountOfSum = (kilogramsOfPalamud * 1.6 * pricePerKiloForSkumriq + kilogramsOfSafrid * 1.8 * pricePerKiloForCaca + kilogramsOfMidi * 7.5);
  17. System.out.printf("%.2f", totalAmountOfSum);
  18. }
  19.  
  20. }
  21. }
  22.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement