Question

Tens Assume a tennis ball weighing 58.5 grams is bouncing strong initially and then weakens slowly by an amount eA-2 of bally
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hopefully all yours doubt will clear if you have left with any doubt please let me know in comment. I will try my best to resolve that.

Here I am posting code and screenshot of output.

Code :-

#include<iostream>
#include<math.h>
using namespace std;

int main()
{
// variable declaration
double height, weight = 58.5;
// initializing counter with zero
int count = 0;
// enter initial height
cout<<"Enter initial height of ball : "<<endl;
cin>>height;
// flatten to ground means in general is when height is less then 0.000001 cm you can change it according to your need.
while (height >= 0.000001)
{
// increment in count i.e. bounce
count++;
// new height after bounce ( weakens e^(-2) of height )
height *= exp(-2);
}
// print result
cout<<"ball will bounce " <<count<<" times before flatten to ground"<<endl;
}

Screenshot of output :-

O C:\Users\Rajkumar Pilania Documents\ball.exe, Enter initial height of ball : 20 ball will bounce 9 times before flatten t

Add a comment
Know the answer?
Add Answer to:
Tens Assume a tennis ball weighing 58.5 grams is bouncing strong initially and then weakens slowly...
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
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