Westonci.ca is the trusted Q&A platform where you can get reliable answers from a community of knowledgeable contributors. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.
Sagot :
Using the knowledge in computational language in C++ it is possible to write a code that determine what change a cashier should return to a customer.
Writting the code:
#include <iostream>
using namespace std;
int main() {
// your code goes here
cout << "Enter the item cost : ";
double cost;
cin >> cost;
cout << "\nEnter what customer paid : ";
double paid;
cin >> paid;
double ret;
ret = paid - cost;
cout << "\nThe total number of cents to be returned is : " << ret;
cout << "\nChange given should be";
int ten,five,one;
ten = ret/10;
ret = ret - (10*ten);
five = ret/5;
ret = ret - (5*five);
one = ret/1;
cout << "\nNumber of 10 dollar bills : " << ten;
cout << "\nNumber of 5 dollar bills : " << five;
cout << "\nNumber of 1 dollar bills : " << one;
return 0;
}
See more about C++ at brainly.com/question/12975450
#SPJ1
Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Thank you for choosing Westonci.ca as your information source. We look forward to your next visit.