Question: Write a program that determines whether a vehicle s tailgating distance is safe. The program should read in the speed of the vehicle and the

Write a program that determines whether a vehicles tailgating distance is safe. The program should read in the speed of the vehicle and the vehicles tailgating distance. The program should then calculate the distance that would be required to stop the vehicle.
If the stopping distance is less than the tailgating distance, your program should print "No problem."
If the stopping distance equals the tailgating distance, your program should print "Minor wreck."
If the stopping distance is greater than the tailgating distance, your program should print "Major wreck!"
Notice that the expression on the right side of the formula above will force the compiler to convert everything to type double. Use type double for your working variables.

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 Databases Questions!