Write a C++ program to help a cashier person when returning change to the customer. Your program should read two real
numbers: the amount of required money and the amount of paid money. The program outputs the change that should be returned
to the customer. Your program should display appropriate error messages for all the invalid cases such as:
• negative amount of required money
• negative amount of paid money
• paid amount less than required amount

Recommended Answers

All 4 Replies

Did you try this on your own?

yes but cant it...if you can pleas help me thank

We don't do your homework for you. Make an effort to solve this simple problem and post your code here. Try working it out on paper first.

Can you code a C++ program that prints a message to ask for input?
(Hint: look up: C++ cout)

Can you code to take in a number?
(Hint: look up: C++ cin)

Do you know how to use an if ... else if ...
structure in C++?
(Hint: look up: ...)

Ok ... now show us the code you have tried so far.

(Start out with just an 'Hello World' type C++ program that prints the first prompt ... and then add-code/compile-test ... as you go ...
from there ... in small increments of added code.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.