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++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr