Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Nickeled and Dimed. Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value

Nickeled and Dimed. Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.

This is what I have:

#include using namespace std; int main() { int quarters,dimes,nickels,cents; cout << "Enter number of quarters, then dimes, then nickels: " ; cin >> quarters>>dimes>>nickels; cents = quarters*25+dimes*10+nickels* 5; cout << cents; return 0; }

It throws this error:

Given the following was entered from the keyboard: 001 you displayed: Enternumberofquarters,thendimes,thennickels:5 instead of:

Enternumberofquarters,thendims,thennickels:5 (<-What does the arrow mean there?)

What am I doing wrong?

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

More Books

Students also viewed these Databases questions

Question

What is the best conclusion for Xbar Chart? UCL A X B C B A LCL

Answered: 1 week ago