Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This challenge is asking you to write a program that will simulate a cash regist

ID: 3755917 • Letter: T

Question

This challenge is asking you to write a program that will simulate a cash register. Ask for the price of an item, the payment amount from the customer, and then print out the change due to the customer but print it out as dollars, the number of quarters, the number of dimes, the number of nickels, and the number of pennies. Hint, this is a good opportunity to work with modules or remainder division. Also allow the user to enter multiple transactions. The Language is C++.

Explanation / Answer

#include using namespace std; int main() { double price, paid; int d, q, di, n, p; char ch; while(true) { cout > price; cout > paid; p = (int) ((paid - price) * 100); d = p / 100; p %= 100; q = p / 25; p %= 25; di = p / 10; p %= 10; n = p / 5; p %= 5; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote