Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Honeycombs_01 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int countBees = Integer.parseInt(scanner.nextLine());
- int countFlowers = Integer.parseInt(scanner.nextLine());
- double totalGramsHoney = 0.21 * countBees * countFlowers;
- double countHoneyPie = Math.floor(totalGramsHoney / 100);
- double leftHoney = totalGramsHoney - countHoneyPie * 100;
- System.out.printf("%.0f honeycombs filled.%n", countHoneyPie);
- System.out.printf("%.2f grams of honey left.", leftHoney);
- }
- }
Add Comment
Please, Sign In to add comment