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