Getting errors stating that 'Assignment3.Converter' does not contain a definition for 'breakdown'...cannot get this to work...I know there is a problem with the breakdown and dollarAmount, but I can't seem to figure out the solution.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment3
{
class Converter
{
private int currency;
public static void converter(int currency, int[] breakdown, int[] demon)
{
int diff = currency;
int x = 0;
while (diff > 0)
{
breakdown[x] = diff / (demon[x]);
diff = diff % demon[x];
x++;
}
}
}
class Conversion
{
static void Main(string[] args)
{
int[] breakdown = new int[4];
int[] demon = { 20, 10, 5, 1 };
Converter converter = new Converter();
Converter.converter(dollarAmount, breakdown, demon);
Console.Write("Please enter a dollar amount: ");//prompts the user for an integer number of dollars
Converter.dollarAmount = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("The amount entered was: {0:c}", Converter.dollarAmount);
Console.WriteLine("Twentys: {0}", Converter.breakdown[0]);
Console.WriteLine("Tens: {1}", Converter.breakdown[1]);
Console.WriteLine("Fives: {2}", Converter.breakdown[2]);
Console.WriteLine("Ones: {3}", Converter.breakdown[3]);
}
}
}