// casting_example.java import java.text.DecimalFormat; // class to format numbers public class casting_example { public static void main(String[] args) { int width, length, area; double carpet_cost, total_cost; width = 5; length = 10; carpet_cost = 6.95; area = width * length; total_cost = (double)area * carpet_cost; System.out.println("The area of the floor is " + area + " ft squared."); System.out.println("The cost of the carpet is $" + carpet_cost + " per foot."); System.out.println("The total cost of the carpet is $" + total_cost ); System.exit(0); } }