Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class FishBazar {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double pricePerKiloForSkumriq = Double.parseDouble(scanner.nextLine());
- double pricePerKiloForCaca = Double.parseDouble(scanner.nextLine());
- double kilogramsOfPalamud = Double.parseDouble(scanner.nextLine());
- double kilogramsOfSafrid = Double.parseDouble(scanner.nextLine());
- int kilogramsOfMidi = Integer.parseInt(scanner.nextLine());
- if (0 < pricePerKiloForSkumriq && pricePerKiloForSkumriq <= 40)
- if (0 < pricePerKiloForCaca && pricePerKiloForCaca <= 30)
- if (0 < kilogramsOfPalamud && kilogramsOfPalamud <= 50)
- if (0 < kilogramsOfSafrid && kilogramsOfSafrid <= 70)
- if (0 <= kilogramsOfMidi && kilogramsOfMidi <= 100) {
- double totalAmountOfSum = (kilogramsOfPalamud * 1.6 * pricePerKiloForSkumriq + kilogramsOfSafrid * 1.8 * pricePerKiloForCaca + kilogramsOfMidi * 7.5);
- System.out.printf("%.2f", totalAmountOfSum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement