Write an application that prompts for and reads "double" value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assuming that a ten-dollar bill is the maximum size needed). For example, if the value entered is 47.63, then the program should print the equivalent amount as: 4 ten dollar bills 1 five dollar bills 2 one dollar bills 2 quarters 1 dimes 0 nickels 3 pennies

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 30PE
icon
Related questions
Question
100%

Write an application that prompts for and reads "double" value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assuming that a ten-dollar bill is the maximum size needed). For example, if the value entered is 47.63, then the program should print the equivalent amount as:
4 ten dollar bills
1 five dollar bills
2 one dollar bills
2 quarters
1 dimes
0 nickels
3 pennies

Using your Eclipse / Java integrated development environment (IDE), develop and code a solution to Programming Project 2.11 from pages 94-95 of the text book.

P 2.13 Write a program that prompts for and reads the numerator and
ing the length of a square's side, then prints the square's perim-
PP 2.12 Write a program that prompts for and reads an integer represent-
age, college, and pet's name. Then print the following paragraph,
94
CHAPTER 2 Data and Expressions
Progromming
1 dimes
O nickles
3 pennies
PP 2.4
Write a program that prompts for and reads a person's name
inserting the appropriate data:
Hello, my name is name and I am age years
old. I'm enjoying my time at college, though
I miss my pet petname very much!
Create a version of the TempConverter application to convert
from Fahrenheit to Celsius. Read the Fahrenheit temperature
from the user.
eter and area.
PP 2.5
denominator of a fraction as integers, then prints the decimal
equivalent of the fraction.
Write a program that converts miles to kilometers. (One mile
equals 1.60935 kilometers.) Read the miles value from the user
as a floating point value.
PP 2.6
PP 2.7 Write a program that prompts for and reads integer values for
speed and distance traveled, then prints the time required for the
trip as a floating point result.
Write a program that reads values representing a time duration
in hours, minutes, and seconds and then prints the equivalent
total number of seconds. (For example, 1 hour, 28 minutes, and
42 seconds is equivalent to 5322 seconds.)
Create a version of the previous project that reverses the
tation. That is, read a value representing a number of seconds,
then print the equivalent amount of time as a combination of
hours, minutes, and seconds. (For example, 9999 seconds is
equivalent to 2 hours, 46 minutes, and 39 seconds.)
PP 2.8
PP 2.9
compu-
PP 2.10 Write a program that determines the value of the coins in a
jar and prints the total in dollars and cents. Read integer values
that represent the number of quarters, dimes, nickels, and
VideoNote
nennies.
Developing a solution
of PP 2.10.
PP 2.11 Write a program that prompts for and reads a double value rep-
resenting a monetary amount. Then determine the fewest number
of each bill and coin needed to represent that amount, starting
with the highest (assume that a ten-dollar bill is the maximum
size needed). For example, if the value entered is 47.63 (forty-
seven dollars and sixty-three cents), then the program should
print the equivalent amount as:
4 ten dollar bills
1 five dollar bills
2 one dollar bills
2 quarterS
Transcribed Image Text:P 2.13 Write a program that prompts for and reads the numerator and ing the length of a square's side, then prints the square's perim- PP 2.12 Write a program that prompts for and reads an integer represent- age, college, and pet's name. Then print the following paragraph, 94 CHAPTER 2 Data and Expressions Progromming 1 dimes O nickles 3 pennies PP 2.4 Write a program that prompts for and reads a person's name inserting the appropriate data: Hello, my name is name and I am age years old. I'm enjoying my time at college, though I miss my pet petname very much! Create a version of the TempConverter application to convert from Fahrenheit to Celsius. Read the Fahrenheit temperature from the user. eter and area. PP 2.5 denominator of a fraction as integers, then prints the decimal equivalent of the fraction. Write a program that converts miles to kilometers. (One mile equals 1.60935 kilometers.) Read the miles value from the user as a floating point value. PP 2.6 PP 2.7 Write a program that prompts for and reads integer values for speed and distance traveled, then prints the time required for the trip as a floating point result. Write a program that reads values representing a time duration in hours, minutes, and seconds and then prints the equivalent total number of seconds. (For example, 1 hour, 28 minutes, and 42 seconds is equivalent to 5322 seconds.) Create a version of the previous project that reverses the tation. That is, read a value representing a number of seconds, then print the equivalent amount of time as a combination of hours, minutes, and seconds. (For example, 9999 seconds is equivalent to 2 hours, 46 minutes, and 39 seconds.) PP 2.8 PP 2.9 compu- PP 2.10 Write a program that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer values that represent the number of quarters, dimes, nickels, and VideoNote nennies. Developing a solution of PP 2.10. PP 2.11 Write a program that prompts for and reads a double value rep- resenting a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assume that a ten-dollar bill is the maximum size needed). For example, if the value entered is 47.63 (forty- seven dollars and sixty-three cents), then the program should print the equivalent amount as: 4 ten dollar bills 1 five dollar bills 2 one dollar bills 2 quarterS
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr