this is simulated data on daily vehicle traffic crossing a bridge for one
week. From Monday through Sunday the daily vehicle counts were {986, 818, 638, 763,
992, 534, 683}. Create an input file named cars_data.dat containing these numbers.
Write a program that will read these values from the input file, and store the values in an
array. The single-dimension array of integers is to be a global variable. The program
should calculate the average daily traffic load of the bridge, and present information on
minimum and maximum traffic. Output should be to the screen in a format similar to the
following:
Day Vehicles
Monday 986
Tuesday 818
...
Sunday ...
Total Vehicles for the week:
Average daily vehicle count:
Day(s) with heaviest traffic count:
Day(s) with lightest traffic count:
Screen output should also be written to a file on the disk. Your program must use a
function solely for reading the data file into the memory array, a different function for
calculating the average, and yet a third function for output. Your program should be able
to accept input files with any values, and must be able to handle unusual situations (e.g.,
what if two days have the same number of cars?)
mikky05v 0 Newbie Poster
mikky05v 0 Newbie Poster
mikky05v 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
mikky05v 0 Newbie Poster
mikky05v 0 Newbie Poster
mikky05v 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
hammerhead 19 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.