OojohnnyoO3632 OojohnnyoO3632
  • 01-04-2020
  • Computers and Technology
contestada

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

Respuesta :

abidhussain7972
abidhussain7972 abidhussain7972
  • 02-04-2020

Answer:

H=(A*D)-(B*(D-1))

H = A*D- B*D+B

H-B = (A-B)*D

D= (H-B)/(A-B)

Python 3 code

import math

H=int(input('Enter Height: '))

up=int(input('Enter Number of Feet Up: '))

down=int(input('Enter Number of Feet Down: '))

D=(H-down)/(up-down)

print(math.ceil(D),' Days'

Explanation:

The output of the Program is given in the attached file.

Ver imagen abidhussain7972
Answer Link

Otras preguntas

What famous line did Elizabeth Cady Stanton write into the declaration of sentiments
Regions around an atom where electrons are orbiting whAt atom structure is this
When a government passes a new law, it is exercising its _____. executive power absolute power judicial power legislative power
For the first time in 16 years, the Presidential Election of 1992 saw
-6x^3y+2xy^2-3xy, para x = 1/6 e y = 1
What difficulty did both Chinese and Japanese immigrants face when trying to pass through immigration stations in the late 1800s and early 1900s?
Evaluate the impact of the bureaucratic leadership style on a business
how do I solve 1/2 x s for s = 3/10
When using a thesaurus, it is beneficial to remember that similar words often have different implied meanings.
How can a young person prevent human rights violations from taking place under your watch?