Question: Language is C++ 2. Frog Race Two frogs named Frog Prime and Frogatron are racing each other to the top of a well of depth

Language is C++
2. Frog Race Two frogs named Frog Prime and Frogatron are racing each other to the top of a well of depth 1000 meters. Each frog can jump up the wall of the well by a certain height but slips down a certain distance due to wetness on the wall. The frogs are not equally fit so the distance that they can jump up and end up sliding down for each jump is different from each other. Both frogs begin at the bottom of the well and take each jump at the same time. The race finishes when one of them clears the well and wins. If bothof them clear the well in the same jump, there is a tie. We want to simualte the race and see who wins. For example, if Frog Prime jumps up 50 meters and slides down 4 meters, and Frogatron jumps up 102 meters and slides down down 2 meters, Frogatron will win in 10 jumps. Function Description Frog Prime can jump prime_up meters at a time but slides down prime_down meters every time. Frogatron can jump tron_up meters at a time but slides down tron_down meters every time. Write a fucnton race that outputs the status of the frogs after each jump and declares the winner when a frog jumps out of the well. It takes the following integer parameters: prime_up, prime_down, tron_up, and tron_down. Constraints All parameters are non-negative. There is guaranteed to be a least one winner. Note This question requires you to know: loops (while). Feel free to ask about them or to look them up online. Input Format For Custom Testing The input contains 4 lines containing the values of prime_up, prime_down, tron_up, and tron_down respectively. You do not have to take input. The input will be read and passed to your function automatically. Your function will then have to produce the corresponding output. Sample Case 0
Step by Step Solution
There are 3 Steps involved in it
Problem Breakdown The task is to simulate a race between two frogs to the top of a well with a depth of 1000 meters The frogs jump and slip back after each jump and we are tasked to determine who wins ... View full answer
Get step-by-step solutions from verified subject matter experts
