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 explorer sailed for france?
least number that has 2, 3, 4, as factors
USE A NUMBER LINE TO FIND 8/9 / 8/45.
Please I have the answers I just want to double check them and Solvekey: B=42  A=93  N=29  X=361. (b-7)(2b-7)2. (4a-4)(5a-7)3. (5n-6)(4n+7)4. (2n=8)(8n+3)5. (6x
The unstated purpose of the Alien and Sedition Acts was to (A) unite the nation in time of danger (B) deport immigrants who were becoming too numerous (C) prote
what is the kingdom and phylum of a euglena protest?
How many miles can you get on one tank of gas if your tank holds 18 gallons and you get 22 miles per gallon?
What were some events/things that caused the Great Depression?
What were some events/things that caused the Great Depression?
least number that has 2, 3, 4, as factors