Answer to Question #200457 in C++ for Adib

Question #200457

Write a program that calculates the final velocity of an object by taking following inputs from the user: vi = initial velocity, a = acceleration, t = time span.


1
Expert's answer
2021-05-30T07:10:58-0400
#include<iostream>
using namespace std;
float CalculateVelocity(float u, float acc, float t)
{
    float v;
    v=u+acc*t;
    return v;
}
int main()
{
    float vi,accl,time;
    cout<<"Enter initial velocity : ";
    cin>>vi;
    cout<<"Enter acceleration : ";
    cin>>accl;
    cout<<"Enter time span : ";
    cin>>time;
    cout<<"Final velocity = "<<CalculateVelocity(vi,accl,time);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog