Changing the value of a double

Hi, I’m back already. I’m creating a change machine that organizes the amount of change a person inputs into quarters, dimes, nickels, and pennies. Google doesn’t seem to understand what I’m saying so hopefully, you can help. After I found the number of quarters I tried to change the value of the original change amount. How can I make this work?
string change = Console.ReadLine();
double changeMoney = Convert.ToDouble(change);
double quarterNumber = Math.Floor(changeMoney / quarterMoney);
Console.WriteLine($“You have {quarterNumber} quarters!”);
double changeMoney = changeMoney - (quarterMoney * quarterNumber);

Do you have more code than what you’ve posted?
(Aside, please review How do I format code in my posts?)

As is your code will throw an error first for trying to declare double changeMoney on line 5 after having already declared it on line 2. Also for referencing quarterMoney on line 3 without having defined it previously.

Yes, sorry I was rushing to get the question out so I could see the responses later.
I want to be able to re-define double changeMoney so I don’t have to write a new variable each time. Idk if that would work or not but if there’s an easier way I would be happy to hear it.
This is the full code:

using System;

namespace Review
{
  class Program
  {
    static void Main(string[] args)
    {
    double quarterMoney = 0.25;
    double dimeMoney = 0.10;
    double nickelMoney = 0.05;
    double pennyMoney = 0.01;
    Console.WriteLine("Tell me how much change you have and I will split it into quarters, dimes, nickels, and pennies! Ex: 1.53");
    string change = Console.ReadLine();
    double changeMoney = Convert.ToDouble(change);
    double quarterNumber = Math.Floor(changeMoney / quarterMoney);
    Console.WriteLine($"You have {quarterNumber} quarters!");
    double changeMoney = changeMoney - (quarterMoney * quarterNumber);
    }
  }
}

I want to be able to subtract the value of the quarters from the original amount so that it can find the number of dimes, nickels, and pennies.

I’m having the urge to point out that you’re counting cents, which can be represented as integer. You have no need for double and may even get unexpected results. In particular, double is not for representing decimal values, it is not for representing numbers you see in grade school.
Numbers used in grade school behave more like strings - because you can write them on paper. Double does not necessarily represent them exactly because it is not a string, it uses a different scheme for representation.

Arguably you should be doing this:

int quarter = 25
int dime = 10
int nickel = 5
int penny = 1
int dollar = 100

Or perhaps you would use fractions.

This, for example:

Could result in 1 too few if you had a result of 5.999999999999999999999999.
You’d be better off rounding, because then it would snap back to what you meant, but you’d still have to dodge lots of pitfalls as a result of using a representation that isn’t what you mean it to be.

Ah, makes much more “cents” now, thank you. Sorry, bad pun. I’m just trying to figure out if there is a better way to do this than assign a new variable every time I want to find the amount of change left. Sorry if this doesn’t make sense, explaining is not one of my strong suits. I now realize that it would take probably longer to re-define the variable but is there a better way to do this?

using System;

namespace Review
{
  class Program
  {
    static void Main(string[] args)
    {
    int quarterMoney = 25;
    int dimeMoney = 10;
    int nickelMoney = 5;
    int pennyMoney = 1;
    Console.WriteLine("Tell me how much change you have and I will split it into quarters, dimes, nickels, and pennies! Ex: 153 cents = 5 quarters, 0 dimes, 0 nickels, and 3 pennies!");
    int userInput = Int32.Parse(Console.ReadLine());
    int quarterNumber = userInput / quarterMoney;
    int leftoverChange1 = userInput - (quarterNumber * quarterMoney);
    int dimeNumber = leftoverChange1 / dimeMoney;
    int leftoverChange2 = leftoverChange1 - (dimeNumber * dimeMoney);
    int nickelNumber = leftoverChange2 / nickelMoney;
    int pennyNumber = leftoverChange2 - (nickelNumber * nickelMoney);
    string splitChange = $"{userInput} cents = {quarterNumber} quarters, {dimeNumber} dimes, {nickelNumber} nickels, and {pennyNumber} pennies!";
    Console.WriteLine(splitChange);
    
    
    }
  }
}

Well yeah but I figured you’d find out through googling or looking at other code.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/assignment-operator