i am new in java program and i try to do some simple java question
this program looks correct but it still has error. can somebody helps me? plz
import java.util.*;
import java.text.*;
public class test2
{
public static void main(String[]args)
{
char i;
double price, cost,costt=0, costn=0;
long quantity, countt=0, countn=0;
Scanner keyboard = new Scanner (System.in);
DecimalFormat f1 =new DecimalFormat("#0.00");
System.out.println("is this taxable ?");
i= keyboard.nextLine().toUpperCase().charAt(0);

while (i=='T' || i=='N')
{
System.out.println("What is the price?");
price = keyboard.nextDouble();
System.out.println("what is the quantity?");
quantity = keyboard.nextLong();
cost= price*quantity;
if (i=='T')
{
cost=cost*1.0875;
countt+=quantity;
System.out.println("There were "+quantity+" taxable items purchased at $"+price+" for and after tax cost of $"+f1.format(cost)+".");
costt+=cost;
}
else
{
costn+=cost;
countn+=quantity;
System.out.println("There were "+quantity+" non-taxable items purchased at $"+price+" for and after tax cost of $"+f1.format(cost)+".");
}
System.out.println("is this taxable ?");
i= keyboard.nextLine().toUpperCase().charAt(0);
}
System.out.println("There were "+countt+" taxable item entries for a total of $"+costt+".");
System.out.println("There were "+countn+" non-taxable entries for a total of $"+costn+".");
System.out.println("There were "+(countt+countn)+" item entries for a total of $"+(costt+costn)+" at an average cost of $"+f1.format((costt+costn)/(countt+countn))+" per item.");
System.exit(0);
}
}