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

5x³-45x (Factor COMPLETELY)
Please help I need a quick answer
Which of the following is true whether you use a direct quote or an indirect quote? You must use quotation marks to indicate the evidence. You must use an int
please help me, thank you
HELPP PLZZZZZZZZZ!!!
A chemist mixed two substances together: a blue powder with no smell and a colorless liquid with a strong smell. Their repeating groups of atoms are shown above
(-1 1/2, -6 1/2) + (-2 1/2, -6 1/2)​
Directions: Read the poem and then answer the questions that follow. The Old Year It passed like the breath of the night-wind away, It fled like a mist at the d
Mary is buying a case of water. She spends $7.99 for a case of 24 bottles. What is the unit rate? (Cost for 1 bottle) *
If you want a job, how do you convince the person that you are the right person for that job?