Welcome to Westonci.ca, the ultimate question and answer platform. Get expert answers to your questions quickly and accurately. Our platform provides a seamless experience for finding reliable answers from a knowledgeable network of professionals. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.
Sagot :
Using the knowledge in computational language in C++ it is possible to write a code that Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0.
Writting the code:
#include<iostream>
using namespace std;
void displayBills(int dollars)
{
int ones,fives,tens,twenties,temp;
twenties = dollars / 20;
temp = dollars % 20;
tens = temp / 10;
temp = temp % 10;
fives = temp / 5;
ones = temp % 5;
cout<< "\nThe dollar amount of ", dollars, " can be represented by the following monetary denominations\n";
cout<<"twenties: "<<twenties<<"\ntens: "<<tens<<"\nfives: "<<fives<<"\nones: "<<ones;
}
int main()
{
int dollars;
cout<<"Please enter the a whole dollar amount (no cents!). Input 0 to terminate: ";
cin>>dollars;
while(dollars!=0)
{
displayBills(dollars);
cout<<"\nPlease enter the a whole dollar amount (no cents!). Input 0 to terminate: ";
cin>>dollars;
}
return 0;
}
See more about C++ at brainly.com/question/18502436
#SPJ1
Visit us again for up-to-date and reliable answers. We're always ready to assist you with your informational needs. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Thank you for visiting Westonci.ca, your go-to source for reliable answers. Come back soon for more expert insights.