Question: This is my code but it keeps looping can you help ma fix it #include #include #include using namespace std; double readSeconds(); double calculateDistance(double seconds);

This is my code but it keeps looping can you help ma fix it
#include
#include
#include
using namespace std;
double readSeconds();
double calculateDistance(double seconds);
void displayResults(double seconds, double distance);
double readSeconds(){
double time;
cout
cin>>time;
while(time
cout
cout
cin>>time;
}
return time;
}
double calculateDistance(double seconds){
double gravity = 9.8;
double distance = 0.5 * gravity * pow(seconds, 2);
return distance;
}
void displayResults(double seconds, double distance){
cout
cout
}
int main() {
while(1) {
double time = readSeconds();
if(time==0)
break;
double distance = calculateDistance(time);
displayResults(time, distance);
}
return 0;
}
 This is my code but it keeps looping can you help
ma fix it #include #include #include using namespace std; double readSeconds(); double
calculateDistance(double seconds); void displayResults(double seconds, double distance); double readSeconds(){ double time; cout
Program generated too much output output rostricted to 50000 characters. Check program for any unterminated loops generating output. Input 20000 meter n 2000 object traveled 1.96e+0 Enter the time (in seconds) Enter the tine (in seconds) The object traveled 470.60 meters in 9.80 nter the time (in seconds) The object traveled 470.60 meters in 9.80 Enter the timo (in seconds) The object traveled 470. 60 meters in 9.80 se ter the time (in seconds) The object traveled 470.60 meters in 9.80 se Enter the time (in seconds) The object traveled 470.60 meters in 9.80 se Enter the tine (in seconds) The object traveled 470.60 meters in 9.80 s Enter the time (in seconds) The object traveled 470.60 meters in 9.80 s Enter the time (in seconds) The object traveled 470.60 meters in 9.80 se Enter the time (in seconds) The obje Enter the tine (in seconda) The object traveled Enter the time (in seconds) The object trav Enter the time (in seconds) The object travel Enter the time (in seconds) ct traveled 470.60 meters in 9.80 s 470.60 meters in 9.80 se eled 470.60 meters in 9.80 se 0.60 meters in 9.80s The object t The object traveled 470 raveled 470.60 meters in 9.80 se ter the time (in seconds) Enter the t .60 meters in 9.80 traveled 470.60 meters in 9.80 ime (in seconds) The object se 8 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!