I have a current assignment for C++ involving us to make a program to determine coin change for example if you input the number 127 you would need 2 half dollars 1quarter and 2 pennies I have no way how to program this tho any help would be awesome.
This is my code that doesn't do what i want it to
#include <iostream>
using namespace std;
int main ( )
{
float change;
int half_dollars, quarters, dimes, nickels, pennies; // declare variables
cout <<"Enter the amount of money: ";
cin >> change; // input the amount of change
half_dollars = change / 50 // calculate half dollars
change= change%50
quarters = change / 25; // calculate the number of quarters
change = change % 25; // calculate remaining change needed
dimes = change / 10; // calculate the number of dimes
change = change % 10; // calculate remaining change needed
nickels = change / 5; // calculate the number of nickels
pennies = change % 5; // calculate pennies