# Help needed

 Georgia Root · September 8, 2014 Please assist me in how I would write this program, I am lost at doing decimals write a utility that converts dollars to coins. It is a simple program that must have the following:Multiple outputs to the screenAt least one inputThe use of integers and stringsLooking or repetition with Do..While, If..ElseMust have some output text to show correct value of coins that would be converted from the dollars.Code must include comments explaining your reason for the code section or what the code is doingCode must compileWhole dollars only. If value is less than 1 or 0, the program should break or exit. int main() { double x; int y; cout << " enter the amount: " <> x ; y=x*100; cout << " You will need " << Y/25 << " quarters " ; y=y%25; cout << " , " << y/10 << "dimes " ; y=y%10; cout << " , " << y/5 << " nickels " ; y=y%5; cout << " , " << y/1 << " pennies " ; return 0;}

## Replies

 Georgia Root · September 9, 2014 int main() { double x; int y; cout << " enter the amount: " <> x ; y=x*100; cout << " You will need " << Y/25 << " quarters " ; y=y%25; cout << " , " << y/10 << "dimes " ; y=y%10; cout << " , " << y/5 << " nickels " ; y=y%5; cout << " , " << y/1 << " pennies " ; return 0;} ragmar thomas · September 9, 2014 ``#include using namespace std;int main() {    int choice;    cout << "to enter the amount of dollar -1" << endl;    cout << "to exit exchange -2" << endl;    cin >> choice;    do{            cout << "1\$ is:- 0-dimes\n\t0-nickel\n\t0-pennies\n" << endl;    break;    }while(choice != 2);``you can insert this kind of statement in your main function with couple of if  - else statements like if (the user input more than 1\$)             your code else        if (the user input less than 1\$)             //you should have more than 1\$ to have changesthese might help you good luck.
• 1

## C++

129,823 followers