Pages

Thursday, July 04, 2013

Write a program to find Translational motion in C++

Write a program which take Translational motion value of Vƒ , Vo and t from user and return value of a along its unit.
Vƒ = Vo + at

Input:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <iostream.h>
#include <conio.h>
int main()
{   cout<<"Translation Motion Formula: a = (Vƒ - Vo)/t\n";
    float FV, IV, V, a, t;    
    cout << "Enter the value of Vo <initial vilosty>?\n";
    cin  >> IV;
    cout << "Enter the value of Vƒ <Final vilosty>?\n";
    cin  >> FV;
    cout << "Enter the value of t <time in sec>?\n";
    cin  >> t;
    V = FV - IV;
    a = (FV - IV)/t;
    cout << "\ta = "<< a <<" m/s "<< endl; 
    getch();
    return 0;
            }

Output:


Translation Motion Formula: a = (Vƒ - Vo)
Enter the value of Vo <initial vilosty>?
23
Enter the value of Vƒ <Final vilosty>?
54
Enter the value of t <time in sec>?
30
a = 1.03333 m/s 


No comments:

Post a Comment