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

Measure of angle A???
the Fourteenth Amendment How did the action resolve a longstanding conflict in post-Civil War America? It defined the process for readmittance of the former Con
You turn your computer on and the computer will not boot up where is something you should do to diagnose the problem?
name the tissue in the vertebrae
What is the value of m in the equation 1/2 m - 3/4n=16 when n=8
Gabrielle's age is two times Mikhail's age. The sum of their ages is 84. What is Mikhail's age?
Ron works for a large American company that is thinking about buying another large company. Before the deal is announced, Ron writes an article for the paper th
PLZ HELP ME! The measure of c is ____.
How many ordered pairs of positive integers satisfy xY=32?
Can anyone tell me how to determine what is being given to me