When trying to call my ToString() method I get the above error message. I’m not sure what the problem is. Here is my code:
public override string ToString()
{
return string.Format("{0} Pizzas @ {1:C}: {2:C}\n" +
"{3} Cokes @ {4:C} {5:C}\n" +
"Order Amount: {6:C}\n" +
"Sales Tax: {7:C}\n" +
"Amount Due: {8:C}\n" +
"Amount Paid: {9:C}\n" +
"Change Due: {10:C}", numberOfPizzas, PIZZA_PRICE +
totalCostOfPizza, numberOfCokes, COKE_PRICE, totalCostOfCoke +
foodAndDrinkTotal, totalSalesTax, totalAmountDue, amountPaid, +
changeDue);
}
You are referencing more arguments in the string format then you are providing.
By the looks of it, drop all the pluses (in the argument list not the string concatenation) and insert commas