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.
All 4 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.