Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python quedtion Instructions A snail goes up A feet during the day and falls B feet at night. How long does it take him to
Python quedtion Instructions A snail goes up A feet during the day and falls B feet at night. How long does it take him to go up H feet? Given three integer numbers H, A and B (A>B), the program should output a number of days. Hint: Let D = the number of days it takes the snail to climb out of the well. This is the variable you will solve for: H= the depth of the well A = the distance the snail climbs during one day B = the distance the snail falls in one night. The amount the snail climbs on a given day Dis: A xD Because the snail won't slide back on the day he escapes from the well, the amount the snail slips from the previous day (D-1 is the previous day) is BX (D - 1) We have to subtract the distance the snail slips from the distance it advamces. So we have the equation: H - (A x D) - (B x Privacy Terms We have to subtract the distance the snail slips from the distance it advamces. So we have the equation: H = (A x D) - (B X (D - 1)) Use your high school algebra to solve for D. Example Input Enter Height: 10 Enter Number of Feet Up: 3 Enter Number of Feet Down : 2 Example Output I 8 Days Example Input Enter Height: 20 Enter Number of Feet Up: 7 Enter Number of Feet Down: 3 Example Output 5 Days Pay-Terma
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started