Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pr.wk02;
- import java.util.Scanner;
- public class number05 {
- public static void main(String[] args) {
- int eggs;
- int gross;
- int extraGross;
- int dozens;
- int extras;
- Scanner rdc = new Scanner(System.in);
- System.out.print("How many eggs do you have? ");
- eggs = rdc.nextInt();
- gross = eggs / 144;
- extraGross = eggs % 144;
- dozens = extraGross / 12;
- extras = extraGross % 12;
- System.out.print("Your number of eggs is ");
- System.out.print(gross + " gross ");
- System.out.print(dozens + " dozen ");
- System.out.print("and " + extras);
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement