write a c++ program that will be used in a grocery store.the program reads a whole change amount in dirhams and prints how many 500 dirham bills,200 dirham bills,100 dirham bills ,50 dirham bills ,20 dirham bills ,10 dirham bills 5 dirham bills ,and 1 dirhams coins should the cashier return to the customer.
for example,if the cashier enters 2789 dirhams,the program should print:
amount entered:2789 Dirhams
5-500 dirham bills
1-200 dirham bills
1-50 dirham bills
1-20 dirham bills
1-10 dirham bills
1-5 dirham bills
4-1 dirham coins
the program should read many positive values and calculate the change for each one stop the program when you enter a 0 or a negative value
the program should use at least one function,one for loop,and one sentinel-controlled while loop.
sarahrasheed 0 Newbie Poster
Stack Overflow 8 Junior Poster
sarahrasheed 0 Newbie Poster
kc0arf 68 Posting Virtuoso Team Colleague
alc6379 commented: Great answer! +3
fahad 3 Light Poster
kc0arf commented: Direct violation of DaniWeb Policy, despite my comments in the forum. +0
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.