Your demo code is required to (DO NOT manually print out, write a FOR loop to do it)
1. print all white furniture
print the total cost of all furniture in the array. // How do i print these using my code:
public class FurnitureDemo
{
public static void main (String[] args)
{
Furniture [] f = new Furniture [6];f[0] = new Chair (100, 1.56, "white", 1.5, 3); f[1] = new Chair (55, 2.52, "black", 2, 3); f[2] = new Table (300, 2.53, "gray", 4, 3, 2.6); f[3] = new Table (220, 3.5, "brown",5, 3, 2.5); f[4] = new Table (250,4.5, "white", 5, 4, 2.6); f[5] = new Round_Table (500,5.5,"white",1.5, 2.4); for(int i=0;i<f.length;i++) { System.out.println(f[i].toString()); } }
}