I found and fixed the problem. I wrote this example program in minutes. Thank god for reading the textbook. :)
// Jonathan Harps
// February 9, 2013
// This is a program practicing some basic Programming Fundamentals
public class Pizza
{
public static void main(String[] args)
{
double cost = 42.59; // The price of the of the Pizza order without tax.
double tax = 0.08; // The amount of tax for the order.
double total; // The total amount of the entire order.
tax = cost * 0.08; // Tax amount based on Texas state regulations
total = cost + tax;
System.out.println("The cost of the pizza order was " + cost);
System.out.println("The amount of tax to be added is " + cost * 0.08);
System.out.print("The total cost of the entire order is " + total + " which is rounded");
System.out.println(" to about $45.99.");
}
}
If you ran the program after you compiled it, it would look like this:
The cost of the pizza order was 42.59
The amount of tax to be added is 3.4072000000000005
The total cost of the entire order is 45.99720000000001 which is rounded to about $45.99.