Assignemnt #27

Code

/// Name: Carlos Sosa
/// Period: 6
/// Program Name: VariablesCanOnlyHoldValues
/// File Name: VariablesCanOnlyHoldValues.java
/// Date Finished: 10/2/15
import java.util.Scanner;
class Only{

    public static void main(String[] args) {
    
   
   
   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

Assignment1.html