There are some issue with the code.
1. The main method should call the printTotalSales with the sales and price parameter, see below.
2. The ; after the method declaration , syntax error
3. The println will not get executed
4. Not clear why the code need to call the method printTotalSales recursively. It should be simply sales * price and return the revenue
public class LemonadeStand {
public static void main(String args[]) {
System.out.println("Total Sales = " + printTotalSales(17,4.45));
}
public static double printTotalSales(int numSales, double price)
{
double revenue = numSales * price;
System.out.println("We sold " + numSales + " units at "+ price + "each, which totals ");
return revenue;
}
}