A C++ program is required to determine how far a car has traveled after 10 secon
ID: 3636040 • Letter: A
Question
A C++ program is required to determine how far a car has traveled after 10 seconds assuming the car is initially traveling at 60mph and the driver applies the brakes to decelerate at a uniform rate of 12 miles/sec2. Use the following formula: s is the initial speed of the car. d is the deceleration. t is the elapsed time. For this programming problem, how many outputs arc required? How many inputs does this problem have? Write an algorithm for converting the input items into output items. Test the -algorithm written for Exercise 5c by using the data given in the problemExplanation / Answer
1)a) output: one 2)a)input:3 3)a) algorithm: 1)start 2)Accept input for car traveled time(in sec),speed(per hour),dccelerate(per sec2) 3)Read the values 4)calculate distance = speed-(1/2)*dccelerate*time*time 5)Display distance 6)End 4)a) #include void main() { int s,t,d,dist; couts>>t>>d; dist=s-(1/2)*d*t*t; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.