Professional Documents
Culture Documents
Taller Clases y Objetos
Taller Clases y Objetos
Design a class that stores in a distance field the Demonstrate the class in a program that uses a loop to
distance, in feet, traveled by a sound wave. display the distance a vehicle has traveled for each hour
The class should have the appropriate accessor and of a time period specified by the user. For example, if a
mutator methods for this field. In addition, the class vehicle is traveling at 40 mph for a three-hour time
should have the following methods:
period, it should display a report similar to the one
shown here.
Test the class in a program that asks the user for the
starting size of the population, their average daily
increase, and the number of days they will multiply.
The program should display the daily population.