The car counting

Revision en1, by johaness, 2019-07-16 14:16:04

A count has been made of the cars that have passed through a track for 24 hours. The results are stored in a file, in an array defined as hourlycars(1), hourlycars(2)... up to hourlycars(24) indicating the index locator the time of day, and the content of the variable the number of cars that passed at that time.

You want to develop a program that can determine:

a) The total number of cars that passed during the day.

b) How many hours of zero transit there were and what they were.

c) What was the hour of maximum transit and what number of cars passed.

d) What was the last time a car passed and what number of cars passed.

You should be able to do it by iterating only once through the array.

Good luck!!

Tags cars, programming, easy

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English johaness 2019-07-16 14:16:04 805 Initial revision (published)