Need some help with looping
This is a basic version of the programming I'm working on.
Now as most of you can see the output is going to be..... 12345.
But I want it to just print out 5 not 12345.
b/c the program I'm trying to make is that you enter an amount of money and it will give you you're amount of money in pennie, nickel, dime, and quarter.
thanks......
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
float pennie = .01;
float nickel = .05;
float dime = .10;
float quarter = .25;
for ( float MoneyEnter = 1.00; MoneyEnter <= 5.00; MoneyEnter++ ) {
cout << MoneyEnter;
}
return(0);
}
here the program i'm working on
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
float MoneyEnter;
float pennie = .01;
float nickel = .05;
float dime = .10;
float quarter = .25;
cout << "Enter amount less then a $1.00 \n>";
cin >> MoneyEnter;
return(0);
}
When the user enter in a number less then a dollar it will tell you the number of quarters, dimes, nickels, and pennies needed.