Need help with displaying calculation
,I want the application to take the product price, read the user input of the quantity wanted, and multiply the price by the quantity. Then, I want the result, the product total to multiply by the tax of 1.08 and give the result in paymentBalance. When I run the application, I keep getting 0 no matter the quantity entered by the user.
Please help.
Code:
package products;
/**
*
* @author Lekeisha
*/
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Products {
public Products()
{
}
public static void main(String[] args)
{
Products products1 = new Products();
products1.inputFromConsole();
}
public void inputFromConsole()
{
// TODO code application logic here
int quantityOrdered = 0;
double productTotal;
double priceItem = 3.95;
double taxPaid = 1.08;
double paymentBalance;
productTotal = priceItem*quantityOrdered;
paymentBalance = productTotal*taxPaid;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("I want this quantity." + "");
try
{
quantityOrdered = br.read();
}
catch
(IOException e)
{
return;
}
System.out.println("This is the total balance. " +(paymentBalance));
}
}