Download presentation
Presentation is loading. Please wait.
Published byPhilip McDonald Modified over 6 years ago
1
Bills Exercise Main Module Declare Integer dollars
1/17/2019 Main Module Declare Integer dollars Declare String message Declare Integer twentiesCtr, tensCtr, fivesCtr, onesCtr Display “What is the dollar amount?” Input dollars While (dollars != 0) twentiesCtr, tensCtr, fivesCtr, onesCtr = 0 While (dollars >= 20) twentiesCtr++ dollars = dollars – 20 End While While (dollars >= 10) tensCtr++ dollars = dollars – 10
2
Exercise 2 While (dollars >= 5) fivesCtr++ dollars = dollars – 5
1/17/2019 Exercise 2 While (dollars >= 5) fivesCtr++ dollars = dollars – 5 End While onesCtr = dollars message = twentiesCtr , " twenty(ies), ” , tensCtr ,“ ten(s), ” , fivesCtr , “five(s) and ”, onesCtr ,“ one(s)” Display message Display “What is the dollar amount?” Input dollars End Module
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.