Hello
class Product
{
private string Produuct;
private decimal Price;
private decimal Vat;
private bool Food;
private int Count;
private const decimal foodVATRate = 0.12m, otherVATRate = 0.25m;
private decimal Finalprice;
private decimal Rate;
public void Start()
{
Readinput();
CalculateValues();
Printrecept();
}
private void Printrecept()
{
throw new System.NotImplementedException();
}
private void CalculateValues()
{
throw new System.NotImplementedException();
}
private void Readinput();
}
Console.Write("\n\nWhat is the product you want: ");
Produuct = Console.ReadLine();
Console.Write("Unit price: ");
decimal.TryParse(Console.ReadLine(), out Price);
Console.Write("Food item y/n: ");
char answer = char.Parse(Console.ReadLine());
if ((answer == 'y') || (answer == 'Y'))
{
Food = true;
Vat = foodVATRate;
}
else
{
Food = false;
Vat = otherVATRate;
}
Console.Write("Count: ");
int.TryParse(Console.ReadLine(), out Count);
private void CalculateValues();
{
Finalprice = Price * Count;
Rate = Finalprice * Vat;
}
private void Printrecept();
{
Console.Write("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++");
Console.Write("\n\nThe product you want is: " + Produuct);
Console.Write("\nThe price: " + Price);
Console.Write("\nFood item: " + Food);
Console.Write("\nCount: " + Count);
Console.Write("\n\nTotal price: " + Finalprice);
Console.Write("\nVAT at " + Rate);
Console.Write("\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
i get 3 errors and i dont know what to do.
A namespace cannot directly contain members such as fields or methods.
this error is for Console.Write("\n\nWhat is the product you want: "); only for consol.
Expected class, delegate, enum, interface, or struct
This error is for void in private void Printrecept();
Expected class, delegate, enum, interface, or struct
this error is for void in private void CalculateValues();