Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout <« fixed « setprecision(2); once before all other cout statements. Ex: If the input is: 4 3 2 1 where 4 is the number of quarters, 3 is the number of dimes, 2 is the number of nickels, and 1 is the number of pennies, the output is: Amount: $1.41

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14PE
icon
Related questions
Question
Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents.
Output each floating-point value with two digits after the decimal point, which can be achieved by executing
cout <« fixed « setprecision(2); once before all other cout statements.
Ex: If the input is:
4 3 2 1
where 4 is the number of quarters, 3 is the number of dimes, 2 is the number of nickels, and 1 is the number of pennies, the output is:
Amount: $1.41
For simplicity, assume input is non-negative.
382800.2462264.qx3zgy7
LAB
2.30.1: LAB: Convert to dollars
0/ 10
АCTIVITY
main.cpp
Load default template..
1 #include <iostream>
2 #include <iomanip>
3 using namespace std;
4
5 int maino
Transcribed Image Text:Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout <« fixed « setprecision(2); once before all other cout statements. Ex: If the input is: 4 3 2 1 where 4 is the number of quarters, 3 is the number of dimes, 2 is the number of nickels, and 1 is the number of pennies, the output is: Amount: $1.41 For simplicity, assume input is non-negative. 382800.2462264.qx3zgy7 LAB 2.30.1: LAB: Convert to dollars 0/ 10 АCTIVITY main.cpp Load default template.. 1 #include <iostream> 2 #include <iomanip> 3 using namespace std; 4 5 int maino
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT