Write a program to process a collection of the speeds of vehicles. Your program should count and print the number of vehicles moving at a high speed (90 miles/hour or higher), the number of vehicles moving at a medium speed (50–90 miles/hour), and the number of vehicles moving at a slow speed (less than 50 miles/hour). It should also display the category of each vehicle. Test your program on the following data: Speed of vehicles (in miles): 43 23 54 57 68 67 51 90 33 22 11 88 34 52 75 12 78 32 89 14 65 67 97 53 10 47 34 b. Modify your program to display the average speed of a vehicle (a real number) at the end of the run.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question

a. USING C PROGRAMMING LANGUAGE

Write a program to process a collection of the speeds of vehicles. Your

program should count and print the number of vehicles moving at a high

speed (90 miles/hour or higher), the number of vehicles moving at a

medium speed (50–90 miles/hour), and the number of vehicles moving at

a slow speed (less than 50 miles/hour). It should also display the category

of each vehicle. Test your program on the following data:

Speed of vehicles (in miles): 43 23 54 57 68 67 51 90 33 22 11

88 34 52 75 12 78 32 89 14 65 67 97 53 10 47 34

b. Modify your program to display the average speed of a vehicle (a real

number) at the end of the run.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr