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

347 cm is equal to: 347 m 34.7 m 3.47 m 0.347 m
What is the mixed number of 7/4
Help please, and thank you Francine and Genevieve were arguing about whether a recursive formula or an explicit formula was better to know to find the 376th ter
what is the meaning of oblivious?
can someone please help me with this
why did international support drop during the president bush second term?
Positive life decisions are usually based on __________. A. your latest interest B. good mental and emotional health C. suggestions by friends D. short-term
About imperialism in world war
A bicycle wheel has 36 evenly-spaced spokes. How many 1 degree turns are between each pair of spokes?
ALL PRIME NUMBERS ARE ODD. true or false