Question: Highway traffic flow analyser Final Practical Project - Mark contributes to the final examination mark. Study the scenario that will monitor and analyse traffic patterns

Highway traffic flow analyser
Final Practical Project - Mark contributes to the final examination mark.
Study the scenario that will monitor and analyse traffic patterns to determine if the road can handle the volume or if it requires expansion
Follow the instructions to develop, test and submit the project.
Click on ADD SUBMISSION to see the details and activity instructions.
Highway traffic flow analyser
Scenario:
Imagine a single-lane road in a suburb of Cape Town that experiences varying traffic flow throughout the day. Over a period of 6 days, traffic engineers need to monitor and analyse these patterns to determine if the road can handle the volume or if it requires expansion. They contacted you, as a student in Computer Science to assist them.
1. Data Collection
The traffic department of Cape Town provides you with the data in a text file (trafficdata.txt)- see attached.
Typical data in the trafficdata.txt:
Timestamp; Vehicle Type; Speed (km/h)
2024-08-0100:00:00; Motorbike; 45
2024-08-0100:14:23; Bus; 115
2. Your C+++ Console Program
Your task is to, using C++, develop a traffic flow analyser that monitors and analyses the flow of cars on a specific stretch of single lane road.
The program will read the captured data from the file and, using appropriate methods and functions, analyse trends, calculate averages, identify peak traffic times, and generate a report to assist road planners in making informed decisions about future road development. You may use any of the functions or methods we have studied throughout the year in this project, but you must include comments in your code explaining each step and your reasoning for choosing specific methods or functions. Additionally, you may include documentation within the comments to help the examiner understand your logic and decisions.
3. Choose any three (3) of the following reports to generate
Report 1. Traffic Summary Report
Total vehicles: The total number of vehicles recorded over the specified period.
Vehicle count per day: A breakdown of the number of vehicles passing per day.
Vehicle type distribution: The number and percentage of each vehicle type (e.g., cars, buses, bikes).
Example output:
Traffic Summary Report:
-----------------------
Total vehicles: 1200
Day 1: 250 vehicles
Day 2: 300 vehicles
...
Vehicle distribution:
- Cars: 800(66.67%)
- Buses: 100(8.33%)
- Motorbikes: 300(25.00%)
Report 2. Peak Traffic Times Report
Hourly peak traffic: Identify the hours with the highest traffic volume.
Daily peak traffic: Determine which day had the most traffic.
Time intervals with maximum congestion: Specific times where the road was most congested.
Example output:
Peak Traffic Times Report:
--------------------------
Peak traffic time (overall): 17:00-18:00 with 150 vehicles
Peak traffic by day:
- Day 1: 16:00-17:00,45 vehicles
- Day 2: 17:00-18:00,60 vehicles
...
Report 3. Speed Analysis Report
Average speed of vehicles: Display the average speed of vehicles passing over the specified period.
Speed ranges: Categorize vehicle speeds (e.g., slow, medium, fast) and report on how many falls into each category.
Example output:
Speed Analysis Report:
----------------------
Average speed: 55.4 km/h
Speed distribution:
- Slow (0-30 km/h): 50 vehicles
- Medium (30-60 km/h): 600 vehicles
- Fast (60+ km/h): 550 vehicles
Report 4. Congestion Level Report
Congestion trends: Identify periods where traffic flow is significantly higher than average, indicating congestion.
Congestion by day/hour: Report on the most congested times of each day and the overall period.
Example output:
Congestion Level Report:
------------------------
Average congestion level: Moderate
Most congested period: Day 3,17:00-18:00, with 80 vehicles
Congestion breakdown by day:
- Day 1: Low (200 vehicles)
- Day 2: High (300 vehicles)
...
Report 5. Custom Time Interval Report
User-specified time intervals: Allow the user to specify custom time intervals (e.g., "report from 09:00 to 12:00 over 5 days") to generate tailored traffic data.
Example output:
Custom Interval Report (09:00 to 12:00):
----------------------------------------
Total vehicles: 400
Average speed: 52.3 km/h
Most congested time: 11:00-12:00,80 vehicles
Report 6. Vehicle Type Specific Report
Traffic trends for specific vehicle types: Provide a report focusing on a particular type of vehicle (e.g., just cars, or buses).
Example output:
Vehicle Type Report (Buses):
----------------------------
Total buses: 150
Peak time: 18:00-19:00,25 buses
Average speed: 40.2 km/h
4. Develop, test and compile your C++ code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!