Assignment #27.2 Variables Only Hold Values Corrected
Code
/// Name: Lacey Reese
/// Period: 5
/// Program Name: VariablesOnlyHoldValues orrected
/// File Name: VariablesOnlyHoldValuesCorrected.java
/// Date Finished 10/12/2015
import java.util.Scanner;
public class VariablesOnlyHoldValuesCorrected
{
// corrected program
public static void main( String[] args )
{
Scanner Lacey = new Scanner(System.in);
double price, salesTax, Total;
System.out.print( "How much is the Item price? " );
price = Lacey.nextDouble();
//price= 7.99;
salesTax= 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
// This is the corrected program to 27