Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Full name: ONID (e... wagstaf): CS 161- Functions: Composition Assume that you have access to the following functions from a C++ library that controls a
Full name: ONID (e... wagstaf): CS 161- Functions: Composition Assume that you have access to the following functions from a C++ library that controls a Mars rover: Float measure wind speed(); /* Measure current wind speed in knots int count rocks (float min size); Number of rocks in size void drive (int meters): 7Drive for the specified number of meters */ sure_Wireloat min D 1. Write a new function that drives for a total of 100 meters, printing out the wind speed every 10 meters along the way (including the start and end points). void sample_windspeed() 2. Write a new function that returns the average number of rocks seen at each waypoint along a 30-meter drive. Waypoints occur every 5 meters, and minimum rock size is a parameter. float survey_rocks (float min_rock_size)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started