JavaHelp (Discount Calculator)
I'm trying to create a class that stores the number of units sold and has a method that returns the total cost of the purchase.
It displays a small chart with the quantity and percent discount.
I cant figure this out, can anyone help?
below is the the code I have so far. :( :confused: :eek:
public class salescommision
public static void main(String args)
total = 99, //The total price before the offered discount was supposed to be 99$
discount = 0,
cost = (total-discount);
Scanner keyboard = new Scanner(System.in);
System.out.println("This program calculates the discounts "
+ "3 test scores.");
System.out.print("Enter quantity: ");
quantity = keyboard.nextDouble();
total = (total * discount);
System.out.println("The total is " + total);
// The goal is if between these number of quantities you will get a certain percent discount
if (total < 19)
else if (total < 49)
else if (total < 99)
else if (total < 100)