O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Exercises

1:Sometimes, the number of cars passing a certain point on a highway needs to be counted. Suppose a person needs to count the cars passing by every hour for one full week. Write a program that can assist this person in storing, retrieving, and analyzing this information. In particular the program must be able to
  • Store car count entries on an hourly basis for 24 hours a day and for 7 days.

  • Let the user enter a specific count by specifying the day, hour, and count.

  • Let the user retrieve a specific count by specifying the day and hour.

  • Calculate and display the total number of counts for the whole week.

  • Determine the number of hours it takes before a given number of cars have passed by. For example, if the first five hours contain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required