double amount = partQuantity * partPrice;

You have that outside of a method. It's probably confused what to do with it.

How about this:


public double getAmount()
{
return...