I'm trying to call a method with 1 argument. However, no matter where I call the method, I get an error saying "class name is not valid at this point."(and in certain places, I also get an error saying "redundant empty statement") The argument I'm calling is a class variable.
Here is my code so it makes a bit more sense with what I'm trying to say
PrintReceipt(Pump aPump); //Method I'm trying to call
public static void PrintReceipt(Pump aPump) //The actual method
{
const double amountDispensed = 0;
DateTime currTime = DateTime.Now;
Console.WriteLine("\nAUTOMATED FUEL DELIVERY SYSTEM");
Console.WriteLine("\nRECEIPT");
Console.WriteLine("\nDate : {0:d}", currTime);
Console.Write("\nPaid ${0} for {1:#.##} litres of ", aPump.getPrice(), amountDispensed);
}
Question
aussieChick
Hey guys,
I'm trying to call a method with 1 argument. However, no matter where I call the method, I get an error saying "class name is not valid at this point."(and in certain places, I also get an error saying "redundant empty statement") The argument I'm calling is a class variable.
Here is my code so it makes a bit more sense with what I'm trying to say
public static void PrintReceipt(Pump aPump) //The actual method { const double amountDispensed = 0; DateTime currTime = DateTime.Now; Console.WriteLine("\nAUTOMATED FUEL DELIVERY SYSTEM"); Console.WriteLine("\nRECEIPT"); Console.WriteLine("\nDate : {0:d}", currTime); Console.Write("\nPaid ${0} for {1:#.##} litres of ", aPump.getPrice(), amountDispensed); }If anyone can help me out, that'd be great.
Thanks in advance,
Britt.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts