In: Computer Science
For a car that travels 70 mph for 60 miles and then 80 mph for 60 miles. The total time traveled is given by calculating the distance per rate traveled for each part and then summing the values. •Have the program in c++ that calculates the most appropriate mean rate of the two different rates and the two equal distances, and output the result to the text file. The “best” mean rate is the rate at which T=D/R is same as if you did it separately where D is the total distance. Output all the data to the text file (include expected results on the display screen).•Example: The program should print something like•A car travels 40mph for 10 miles and 50 mph for 10 miles.•The total time traveled given by T=D1/R1 + D2/R2 is [your answer].•The best mean rate R is [your answer].•The total time given by this mean and T=D/R is [your answer]