-1

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

4
Contributors
4
Replies
22
Views
3 Years
Discussion Span
Last Post by David W
0

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.

0

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.)

Edited by David W

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.