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

whaat is the 2 power tp 4
walking in the winter wonderland here comes ________right down Santa claus lane
I am having trouble with a problem that asks what the mistake a student made and to write down the correct equation.​
Help me as soon as possible I’m gonna dieeee
what impact did the purchase of the louisiana territory have on the united states?
so heres my nana edit don't delete plz ik it trash compare to my other ones T^T(so this wont go away 2x+3x=?
ANNIE: Mr. Anagnos. (Her voice is trembling.) Dear Mr. Anagnos, I— (But she swallows over getting the ring on her finger, and cannot continue until she finds a
Hi how are you? ✌ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤
Kai is a clinical health-care provider. Which could be Kai's job? O a medical transcriptionist O an occupational therapist O a cardiologist O a central supply
What is the difference between mutation that occur on somatic cells and sex cells?