The line Moneyl = Moneyl;
needs to be replaced with Moneyl = Money;
so that you are not just trying to assign that variable the value it already had.
Also, you it looks like you'll need to fix how you calculate nickels and pennies because it doesn't take into account all previous coins. You could try something like Moneyl -= quarters * 25
to make finding all of your other coins easier.
i get the first part which i never ment to put in there in the first place
but i dont really get the second port were am i spo to put it and what is it solving for
What I was trying to say is that the line where you calculate nickels only takes account of the dimes, not the quarters. The easiest way to take care of this would be to just take each value out of money1 as you find it. Here's what I mean:
#include<iostream>
usingnamespace std;
int main(){
double Money = 0.00;
int Money1;
int quarters;
int dimes;
int nickels;
int pennies;
cout <<" Welcome to Dollars to coins " << endl;
cout <<" Type in amount: ";
cin >> Money;
Money = Money * 100;
Money1 = Money;
quarters = Money1 / 25; // Find quarters
Money1 -= quarters * 25; // Remove quarters
dimes = Money1 / 10 // Repeat with other coins...
Money1 -= dimes * 10;
nickels = Money1 / 5;
Money1 -= nickels * 5;
pennies = Money1;
cout <<" quarters " << quarters <<" dimes " << dimes <<" nickels "
<< nickels <<" pennies " << pennies << endl;
system("PAUSE");
return 0;
}
Each line here takes out the value of the coins the program found. The extra lines then remove the value of those each coin by subtracting from the total value the number of coins multiplied by each coin's appropriate value.
This one gets a warning when i change int to float but it works just fine
The program i use dosent like the - sigh before the equals sigh
thanks any way