Write a C++ program to perform the following:
1) Input a positive integer total that represents the total distance in meters a person needs to travel.
2) Input a positive integer first that represents the distance of the first jump. This distance should be less than or equal to total/20. If first is greater than total/20 then set it to total/20.
3) Using a loop calculate how many jumps are needed to cover the total distance.
After every jump, the person jumps 1 meter more than the previous jump. See the
input and output for more examples.
Please note, that this is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attemts to solve this problem youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics
surely you must want to use doubles instead of integers. Also you should divide by 20./20.0/20.0f not 20 since 20 is an integer and to get a floating-point you must divide by a double or float(both floating-point data types).