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

name 6 communication blockers
Why are convection currents; why are they hotter and colder parts of earth
What was the purpose of the 18th ammendment?
The excerpt most reflects which Enlightenment idea? A. Separation of powers. B. Social contract. C. Direct democracy. D. Republicanism.
Is this a 330 degree angle?
Which of the following statements is true? a. you should never use a blog as a source, because it will reduce your credibility. b. you can use blogs selective
Choose the correct english equivalent for this word: ��camine! a. come! b. run! c. walk! d. cry!
What is the theme of a story is the that the author wants to teach readers about.?
Which statements describe Russian serfs? A. They made up more than three-quarters of the population. B. They owned the land on which they worked. C. They were r
how fo you solve square root 100x radical 8