/************************************************* ** Full Name: ** Username : ** Date : *************************************************/ #include <iostream> using namespace std; int main () { double mass, vel, KE;

//variable declarations and initialisation cout <<"Please enter the mass in kilogramme."<< endl; //prompt and read cin >> mass cout << "please enter the speed in metre per second."<< endl; cin >> vel KE=0.5*mass*vel*vel; //calculate kinetic energy cout << " A mass of" << mass << " kg at a speed of " << vel << "metre pe r second has a kinetic energy of " << KE << "J." << endl; //print result cout << " Thankyou for using the kinetic energy calculator."<< endl; //s ign off politely } //end of main()

Sign up to vote on this title
UsefulNot useful