0

I keep getting the error message "retailPrice cannot be resolved to a variable". I am getting it on several other lines as well but let's just start here.

import java.text.DecimalFormat;
class Billing

    {
      public static void main(String[] args)
      {
        computeBill(19.99);
        computeBill(19.99, 3);
        computeBill(19.99, 3, .20);
        computeBill(19.99, 3, .20, .10);
      }
      public static void computeBill(double book)
      {
        DecimalFormat f = new DecimalFormat("0.00");
        double retialPrice = (book * .085) + book;
        String total = (f.format(retailPrice));
        System.out.println("The photo book after tax is $" + total);
                           }
Jee Mok
  • 6,157
  • 8
  • 47
  • 80

1 Answers1

0

You mispelled your variable name. see line:

    double retialPrice = (book * .085) + book;

You declare it misspelled as retialPrice, then in the next line you reference it spelled correctly as retailPrice.

JamieT
  • 1,177
  • 1
  • 9
  • 19