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

Which statement about Shays' Rebellion is false? A. Daniel Shays resigned from the Continental Army. B. Poor farmers could be sent to debtor's prison. C. The ce
Can you give examples of carbon in our nonliving environment?
4% of what number is 25?
which elements make up a family
i need help with math 1010completing the squarex^2-9x=10
Which of the following cell organelles surrounds the nuclear membrane? A; rough endoplasmic reticulum B; smooth endoplasmic reticulum C; the Golgi apparatus
Two right triangles with the following dimensions are graphed with their hypotenuses on the same line: triangle X: horizontal leg measures 4 units vertical leg
1)Which of the following describes a basic concept of democracy.? A) individual worth is valued more than the protection of all citizens. B) all men are of equa
what is the definition of inherent power
In laboratory volume of liquid are usually measured with a (n)