homework9 - 15-100 HOMEWORK 9 - FALL 2007Answer the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15-100 HOMEWORK 9 - FALL 2007Answer the following questions on paper and hand in at the start of class on the due date indicated. 1. Let a ParkingLotclass be defined as in homework #8. You may assume that the Carclass has a getMake()method. (a) Complete the method below for the ParkingLotclass that creates and returns a new ParkingLotthat contains only those cars in this parking lot that have a make that matches the make given in the parameter of the method. public _____________ makeNewLot(String make){ // Makes a brand new parking lot that contains only // those cars from this parking lot that have a make // that matches the make given in the parameter ParkingLot newLot = new ParkingLot(); for (int index = 0; index < _______________; index++) { // does the car in the array at the current index // have the same make as the make given in the // parameter? if (________________________________________) { // if so, put it in the new lot also ______________________________________; } } return newLot;...
View Full Document

This note was uploaded on 01/25/2010 for the course CS 15100 taught by Professor Tom during the Fall '07 term at Carnegie Mellon.

Page1 / 2

homework9 - 15-100 HOMEWORK 9 - FALL 2007Answer the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online