Question

Do not prompt the user for input during the execution of your program. Do not pause at the end of the execution waiting for tCheck. There is a comment box above the function definition that contains the description of the function, a description of tTime Traveled Distance Traveled (in seconds) (in meters) 1 4.90 2 19.60 3 44.10 4 78.40 5 122.50 6 176.40 7 240.10 8 313.60 9

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

#include <iostream>
#define GRAVITY_CONSTANT 9.8
using namespace std;
double fallingDistance(int t)
{
return 0.5*GRAVITY_CONSTANT*t*t;
}
int main()
{
cout<<"Time Travelled\tDistance Travelled\n";
cout<<"(in seconds)\t(in meters)\n";
cout<<"======================================\n";
for(int i=1;i<=12;i++)
{
cout<<"\t"<<i<<"\t"<<fallingDistance(i)<<endl;
}
  
return 0;
}

main.cpp 1 include <iostream> 2 #define GRAVITY_CONSTANT 9.8 3 using namespace std; 4 double fallingDistance(int t) 5-{ 6 ret

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Do not prompt the user for input during the execution of your program. Do not pause...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ LANGUAGE The following formula can be used to determine the distance an object falls in...

    C++ LANGUAGE The following formula can be used to determine the distance an object falls in a specific time period: d = 1 2 g t 2 where d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, the object has been falling. Write a function named fallingDistance that accepts an object's falling time in seconds as an argument. You must define a named constant for g using a meaningful name and...

  • Java: Create a main method for your class, and then add another method to your class...

    Java: Create a main method for your class, and then add another method to your class (above the main method) named fallingDistance. This method accepts an integer into its parameter t, which is the amount of time, in seconds, that an object has been falling. This method returns the distance, in meters, that the object has fallen during the time interval. When an object s falling because of gravity, we use the following formula to determine the distance the object...

  • write program in java 5. Falling Distance When an object is falling because of gravity, the...

    write program in java 5. Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2 gta The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a method named fallingDistance that accepts an object's falling time...

  • PYTHON HOMEWORK When an object is falling because of gravity, the following formula can be used...

    PYTHON HOMEWORK When an object is falling because of gravity, the following formula can be used ot determine the distance the object falls during a specific time period: d=1/2 g t^2 The variables in the formula are as follows: d is the distance in meters(m), g is the acceleration due to gravity, an and its value is 9.8 m/s^2, t is the time duration in seconds(s). Write a function named falling_distance() that accepts an object's falling duration(time) in seconds as...

  • Lab Exercise #11 Assignment Overview You will work with a partner on this exercise during your la...

    help with cse problem Lab Exercise #11 Assignment Overview You will work with a partner on this exercise during your lab session. Two people should work at one computer. Occasionally switch the person who is typing. Talk to each other about what you are doing and why so that both of you understand each step Part A: Class Date . Download the files for this laboratory exercise, then run the Python shell and enter the following commands: >>>import date >>help(...

  • c++ program Notes 1. Your program should use named string constant for the file name to open the file. Do not add any pa...

    c++ program Notes 1. Your program should use named string constant for the file name to open the file. Do not add any path to the file name because the path on your computer is not likely to exist on the computer the instructor uses to grade the program. Points may be deducted if you don't follow this instruction. 2. Split statements and comments longer than 80 characters into multiple lines and use proper indentations for the split portions. 3....

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • Write a C++ program that demonstrates use of programmer-defined data structures (structs), an array of structs, passing...

    Write a C++ program that demonstrates use of programmer-defined data structures (structs), an array of structs, passing an array of structs to a function, and returning a struct as the value of a function. A function in the program should read several rows of data from a text file. (The data file should accompany this assignment.) Each row of the file contains a month name, a high temperature, and a low temperature. The main program should call another function which...

  • Instructions: For this assignment, you will write the first part of a program that allows a...

    Instructions: For this assignment, you will write the first part of a program that allows a customer to plan for retirement. Note: This program has no user input Write a "pure" Python function named 'calc_final_balance' that calculates the final balance in a retirement account after annual savings accrue for and earn interest for a number of years. This is a simulation problem similar to the Credit Card sample program, except it is to be written as a function definition (which...

  • 5.15 PROGRAM: Functions - Upset Fowls (C++) (1) Correct the first FIXME by moving the intro...

    5.15 PROGRAM: Functions - Upset Fowls (C++) (1) Correct the first FIXME by moving the intro text to the function stub named PrintIntro and then calling the PrintIntro function in main. Development suggestion: Verify the program has the same behavior before continuing. (2) Correct the second FIXME by completing the function stub GetUsrInpt and then calling this function in main. Notice that the function GetUsrInpt will need to return two values: fowlAngle and fowlVel. (3) Correct the third FIXME by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT