nvm guys, I apologize. i messed with it enough and figured it out. i couldn't use a package with java as the name.
package newstuff;
import java.text.NumberFormat;
import java.util.Scanner;
public class tryValidatedInvoiceApp
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String choice = "y";
while (!choice.equalsIgnoreCase("n"))
{
System.out.print("Enter customer type (r/c): ");
String customerType = sc.next();
if (customerType.equals("r"))
{
System.out.print("Enter subtotal: ");
double subtotal = sc.nextDouble();
// get the discount percent
double discountPercent = 0;
if (customerType.equalsIgnoreCase("C"))
{
if (subtotal < 250) {
discountPercent = .2;
}
else {
discountPercent = .3;
}
}
else {
discountPercent = .1;
}
// calculate the discount amount and total
double discountAmount = subtotal * discountPercent;
double total = subtotal - discountAmount;
// format and display the results
NumberFormat currency = NumberFormat.getCurrencyInstance();
NumberFormat percent = NumberFormat.getPercentInstance();
System.out.println(
"Discount percent: " + percent.format(discountPercent) + "\n" +
"Discount amount: " + currency.format(discountAmount) + "\n" +
"Total: " + currency.format(total) + "\n");
// see if the user wants to continue
System.out.print("Continue? (y/n): ");
choice = sc.next();
System.out.println();
}else if(customerType.equals("c"))
{
System.out.print("Enter subtotal: ");
double subtotal = sc.nextDouble();
// get the discount percent
double discountPercent = 0;
if (customerType.equalsIgnoreCase("R"))
{
if (subtotal < 100) {
discountPercent = 0;
}
else if (subtotal >= 100 && subtotal < 250) {
discountPercent = .1;
}
else if (subtotal >= 250) {
discountPercent = .2;
}
}
// calculate the discount amount and total
double discountAmount = subtotal * discountPercent;
double total = subtotal - discountAmount;
// format and display the results
NumberFormat currency = NumberFormat.getCurrencyInstance();
NumberFormat percent = NumberFormat.getPercentInstance();
System.out.println(
"Discount percent: " + percent.format(discountPercent) + "\n" +
"Discount amount: " + currency.format(discountAmount) + "\n" +
"Total: " + currency.format(total) + "\n");
// see if the user wants to continue
System.out.print("Continue? (y/n): ");
choice = sc.next();
System.out.println();
} else
{
sc.nextLine();//discard anything on the line
System.out.println("error! Invalid number.Try again.");
continue;}
}
}
}