Isiah K.

asked • 10/12/20

My assignment is to debug this code, I have submitted code multiple times and cannot get it right. Can you please explain to me what exactly is wrong with this code and how I can fix it?

import java.util.*;

public class DebugTwo4

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

string costString;

double cost;

final TAX = 0.06;

System.out.println("Enter price of item you are buying");

costString = input.next();

cost = Double.parsedouble(coststring);

System.out.println("With " + TAX * 100 +

"% tax, purchase is $" + cost + cost * TAX);

}

}


1 Expert Answer

By:

Patrick B. answered • 10/31/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.