Answered step by step
Verified Expert Solution
Question
1 Approved Answer
blic class ChangeMaker oublic statie void main (String args) int amount, originalAmount, quarters, System.out.println (Enter a whole number from I to 99.): System.out.printin (I will
blic class ChangeMaker oublic statie void main (String args) int amount, originalAmount, quarters, System.out.println ("Enter a whole number from I to 99."): System.out.printin ("I will find a combination of coins"); System put printin ("that equals that amount of change."): Scanner kevboard- new Scanner (System.in); amountkeyboard.nextInt 0: originalaruount- amount; quartersamount / 25; amountamount % 25: dimes mount / 10; dimes, nickels, pennies; amount amount % 10; nickels amount / 5; amount amount % 5; penniesamount; System eut.println (originalAmount + cants in coins can be given as:"); System ut.printin (quarters +" quarters"); System.out.println (dimes + " dimes"); System.out.println (nickels + " nickels and"); System t printin (pennies + " pennies"); Punts public class EggBasket oublic static void main (String [] args) int numberOfBaskets, eggsPerBasket, totalEggs; numberOtBaskets = 10; eggsPerBasket = 6; totalEggs= numberOfBaskets * eggsPerBasket; System out.println ("If you have"); System ut.println (eggsPerBasket +" eggs per basket and"); System olt.println (numberOfBaskets +" baskets, then"); System out.println ("the total number of eggs is "+ totalEggs)B blic class ChangeMaker oublic statie void main (String args) int amount, originalAmount, quarters, System.out.println ("Enter a whole number from I to 99."): System.out.printin ("I will find a combination of coins"); System put printin ("that equals that amount of change."): Scanner kevboard- new Scanner (System.in); amountkeyboard.nextInt 0: originalaruount- amount; quartersamount / 25; amountamount % 25: dimes mount / 10; dimes, nickels, pennies; amount amount % 10; nickels amount / 5; amount amount % 5; penniesamount; System eut.println (originalAmount + cants in coins can be given as:"); System ut.printin (quarters +" quarters"); System.out.println (dimes + " dimes"); System.out.println (nickels + " nickels and"); System t printin (pennies + " pennies"); Punts public class EggBasket oublic static void main (String [] args) int numberOfBaskets, eggsPerBasket, totalEggs; numberOtBaskets = 10; eggsPerBasket = 6; totalEggs= numberOfBaskets * eggsPerBasket; System out.println ("If you have"); System ut.println (eggsPerBasket +" eggs per basket and"); System olt.println (numberOfBaskets +" baskets, then"); System out.println ("the total number of eggs is "+ totalEggs)B
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started