Question: C + + Project 4 : Stopping Distance: If you follow too close behind another car and that other car stops suddenly, you will not
C
Project :
Stopping Distance:
If you follow too close behind another car and that other car stops suddenly, you will not be able to stop in time, and you will crash into the rear of that other car. The following formula gives the distance between you and the car in front which allows you to stop safely:
stoppingDistance speed speed
a Write a program which determines whether a vehicle's tailgating distance is safe. The program should read in the speed of the vehicle and the vehicle's 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!"
Sample session:b Notice that one of the tests is a comparison for equality. Since the probability of two real numbers being exactly equal is zero, if you use floating point numbers there will never be an input that produces a minor wreck. Modify the program so that it allows a range of uncertainty entered by the user, within which the result will be a minor wreck.c Allow the user to enter the speed in kmph or mph and the distance in the corresponding unit m or feet Write a program to mimic a unit converter or currency converter at least different types: For example:
table meter feet, USD AED mile, GBP EURO inch, EURO USD AUD AED
The program should permit the user to keep going or terminate after each calculation is made.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
