Assignment 27 and Variables Only

Code

/// Name: Matthew Hughs
/// Period: 5
/// Program Name: Variables Only
/// File VaribalesOnly.java
/// Date Finished: 9/30/2015

import java.util.Scanner;
  
  public class VariablesOnly
  {
      public static void main( String[] args )
      {
  
         Scanner keyboard = new Scanner(System.in);
         double price = 0, salesTax, total;

         salesTax = price * 0.0825;
         total = price + salesTax;
 
         System.out.print( "How much is the purchase price? " );
         price = keyboard.nextDouble();
 
         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

VariablesOnly