I am having problems getting this program to work. It will not compile due to errors for dollarAmount and Breakdown. Could someone please help
namespace test
{
class Converter
{
//classs variable
private int currency;
public void converter(int currency, int[] breakdown, int[] denom)
{
int diff = currency;
int x = 0;
while (diff > 0)
{
breakdown[x] = diff / (denom[x]);
diff = diff % denom[x];
x++;
}
}
}
class Conversion
{
static void Main(string[] args)
{
int[] breakdown = new int[4];
int[] denom = { 20, 10, 5, 1 };
Converter converter = new Converter();
converter.converter(dollarAmount, breakdown, denom);
Console.Write("Please enter a Dollar amount: ");
converter.dollarAmount = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("The Dollar Amount Entered Was: {0:c}", converter.dollarAmount);
Console.WriteLine("Twentys: {0}", converter.breakdown[0]);
Console.WriteLine("Tens: {0}", converter.breakdown[1]);
Console.WriteLine("Fives: {0}", converter.breakdown[2]);
Console.WriteLine("Ones: {0}", converter.breakdown[3]);
// Internal Documentation.
} //end main
} //end class
} //end namespace