Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

=+development and make the product, should you go ahead and do so?

Answered: 1 week ago