Response:
Clarification:
import java.Util;
public class Eggs{
public static void main (String [] args)
{
int eggCount, dozens, remainingEggs;
float finalAmount;
Scanner scanner = new Scanner(System.in);
eggCount = scanner.nextInt();
if(eggCount < 0)
{
System.out.print("Invalid");
}
else
{
if(eggCount >= 12)
{
dozens = eggCount/12;
remainingEggs = eggCount % 12;
}
else
{
dozens = 0;
remainingEggs = eggCount;
}
finalAmount = dozens * 3.25 + (remainingEggs * 45)/100;
System.out.print("You have ordered "+eggCount+" eggs.\n");
System.out.print("This amounts to "+dozens+" dozen at $3.25 each and "+remainingEggs+" loose eggs at 45 cents each, totaling $"+finalAmount);
}
}
}