#include <iostream>
usingnamespace std;
using std::cout;
using std::endl;
int space(int& mass); // Function
int main(void)
{
int velocity;
int distance;
int time;
int mass=205; // mass of object
int momentum=0;//speed of object
int distance=1000;// distance
int result = space(mass);
cout << endl << "(mass*velocity) =" << result
<< endl << "(mass) = "<< mass;
result = (velocity);
cout << endl << "(velocity)=“ << result
<< endl << "value = " << endl;
for (int i = 1; i <2; ++i)
cout << time << "";
cout << "(velocity=distance/time) =" <<result
cout << " value = " << endl;
return 0;
}
// program does not work I do not know where I am going wrong
// I do not want the answer but I need some gudiance.
I do not know what your program is meant to do but errors I can see are: You need not declare that you are using std::cout and std::endl, if you have declared you are using std. Secondly your declaration for the function space should have a '*' not a '&'. And finally there is no implementation of the space function.
"Secondly your declaration for the function space should have a '*' not a '&'."
No, it's fine the way it is. An ampersand denotes either the address of something, or a reference to something. In this case, it's a reference to something.
Edit: On line 21, your double-quote (“) doesn't match the others.