Let’s say I have X coins with a value of 1…

  • coins a have the value of 1;
  • coins b have the value of 10 (10*a);
  • coins c have the value of 500 (50*b)

I have this simple class:

public class Currency { public Currency(int amount) { allCoins = amount; } private int allCoins; public int stoneCoins { get { if(all) } } } public int CopperCoins { get { return allCoins % 50; } } public int SilverCoins { get { return allCoins % 100; } } } 

allCoins is the value of the money.

Now, how do I show allCoins = 12 in the format of:

a = 2; b = 1; c = 0 

Sorry if I picked wrong subreddit to ask this question ;D

by MrReynevan2 via /r/csharp

Leave a Reply