add the getTotalPrice method in ending Machine