Assignemnt #27 and Sequencing
Code
///Name: Ben Borglin
///Period: 6
///Program Name: Sequencing
///File Name: Sequencing.java
///Date:9/22/15
import java.util.Scanner;
public class Sequencing
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double price, salesTax, total;
System.out.print( "How much is the purchase price? " );
price = keyboard.nextDouble();
salesTax = price * 0.0825;
total = price + salesTax;
System.out.println( "Item price:\t" + price );
System.out.println( "Sales tax:\t" + salesTax );
System.out.println( "Total cost:\t" + total );
//No error is giving. I understand and I am not suprised by the output because the salestax and total were before the price variable was asked in the program so it would plug in 0 for price and the formula will result in 0.
}
}
Picture of the output