Physics: Acceleration

less than 1 minute read

The code has been modified slightly and now uploaded to the site.

Question

<— Return Home

29.cpp

#include <iostream>
using namespace std;

int main(){
    double v0;
    double v1;
    double t;
    double avg;

    std::cout << "Enter v0, v1, and t: \n";
    std::cin >> v0;
    std::cin >> v1;
    std::cin >> t;

    avg = (v1 - v0) / t;

    std::cout << "The average acceleration is " << avg; // Type ./29<29input.txt to send input text to here
}

<— Return Home

Input (29input.txt)

5.5
50.9
4.5

<— Return Home