Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create find_max_height.cpp #3041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aditya-chouksey wants to merge 1 commit into TheAlgorithms:master
base: master
Choose a base branch
Loading
from aditya-chouksey:patch-2

Conversation

@aditya-chouksey
Copy link

@aditya-chouksey aditya-chouksey commented Oct 17, 2025
edited
Loading

This C++ program calculates the maximum height a ball will reach when thrown vertically upward with a given initial velocity. The program uses the standard equation of motion derived from basic physics:

h

v
2
2
g
h=
2g
v
2

where:

  1. h is the maximum height (in meters),

  2. v is the initial velocity of the ball (in meters per second), and

  3. g is the acceleration due to gravity (9.8 m/s2 on Earth).

The user inputs the initial velocity, and the program computes and displays the corresponding maximum height. This program helps understand the relationship between velocity and height in projectile motion under uniform gravity.

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

This C++ program calculates the maximum height a ball will reach when thrown vertically upward with a given initial velocity. The program uses the standard equation of motion derived from basic physics:
h
=
v
2
2
g
h= 
2g
v 
2
 
​
 
where:
1. h is the maximum height (in meters),
2. v is the initial velocity of the ball (in meters per second), and
3. g is the acceleration due to gravity (9.8 m/s2 on Earth).
The user inputs the initial velocity, and the program computes and displays the corresponding maximum height.
This program helps understand the relationship between velocity and height in projectile motion under uniform gravity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Panquesito7 Panquesito7 Awaiting requested review from Panquesito7 Panquesito7 is a code owner

@realstealthninja realstealthninja Awaiting requested review from realstealthninja realstealthninja is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /