Problem 2: When a particular rubber ball is dropped from a given height (in meters), its impact speed (in meters/second) when it hits the ground is given by the formula: speed S = /2gh %3D where g is the acceleration due to gravity and h is the height. The ball then rebounds to 2/3 the height from which it last fell. Using the formula, design, write and run a C++ program that will accept input values from the user at run time and display the impact speed of the first three bounces and the rebound height of each bounce. Test your program using an initial height of 18 m. Run your program twice, and compare the results for dropping the ball on Earth (g 9.81 m/s²) and on the Moon (g = 1.67 m/s2). [Hint: In Step 2: Design a solution, use a Table to organize the solution before going to Step 3: Coding] Save this program as Module3Proj2.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Problem 2: When a particular rubber ball is dropped from a given height (in meters), its
impact speed (in meters/second) when it hits the ground is given by the formula:
speed S = /2gh
%3D
where g is the acceleration due to gravity and h is the height. The ball then rebounds to
2/3 the height from which it last fell. Using the formula, design, write and run a C++
program that will accept input values from the user at run time and display the impact
speed of the first three bounces and the rebound height of each bounce. Test your
program using an initial height of 18 m. Run your program twice, and compare the
results for dropping the ball on Earth (g = 9.81 m/s?) and on the Moon (g = 1.67 m/s2).
[Hint: In Step 2: Design a solution, use a Table to organize the solution before going to
Step 3: Coding]
Save this program as Module3Proj2.
Transcribed Image Text:Problem 2: When a particular rubber ball is dropped from a given height (in meters), its impact speed (in meters/second) when it hits the ground is given by the formula: speed S = /2gh %3D where g is the acceleration due to gravity and h is the height. The ball then rebounds to 2/3 the height from which it last fell. Using the formula, design, write and run a C++ program that will accept input values from the user at run time and display the impact speed of the first three bounces and the rebound height of each bounce. Test your program using an initial height of 18 m. Run your program twice, and compare the results for dropping the ball on Earth (g = 9.81 m/s?) and on the Moon (g = 1.67 m/s2). [Hint: In Step 2: Design a solution, use a Table to organize the solution before going to Step 3: Coding] Save this program as Module3Proj2.
Expert Solution
Step 1: Earth case

Algorithm:

step1: take height and g value from user(for both moon and earth case separately)

step2:declare and initializes required variables;

step3: calculate speed as speed=sqrt(2*g*h)

step4: update height for each bounce

step5: update values of i(denote for each bounce)

step6: stop

 

 

# Source_code 

#include <iostream>
#include<cmath>
using namespace std;

int main()
{
   float intial_height,speed;
  float g;
   int  i=1;
  cout<<"Enter the height:";
  cin>>intial_height;
  cout<<"Enter earth  gravity value:";
  cin>>g;

  while(i<=3){
      speed=sqrt(2*g*intial_height);
      cout<<"Speed at bounce\t"<<i<<" is :"<<speed<<endl;
      intial_height=(intial_height*2)/3;
      cout<<"height after\t"<<i<<" bounce is:"<<intial_height<<endl;
      i++;
      
  }

    return 0;
}

Computer Engineering homework question answer, step 1, image 1

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY