Assignemnt #27
Code
/// Name: Ryan Volko
/// Period: 7
/// Program Name: VariablesError
/// File Name: VariablesError.java
/// Date Finished: 9/2/2015
import java.util.Scanner;
public class VariablesError
{
public static void main( String[] args )
{
// fixed
Scanner keyboard = new Scanner(System.in);
double price = 0, 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 );
}
}
Picture of the output