case 4: // //Compute sum of price of all sailboats and powerboats // //sum total prices by type of boat for (Boat bt : boatList) { if (bt instanceof SailBoat) { //Sailboat SailBoat sb = (SailBoat) bt; totalSail += sb.calcPrice(); } else { //PowerBoat PowerBoat bp = (PowerBoat) bt; totalPower += bp.calcPrice(); } }//end for break;