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

There is an inverse relationship between x and y. If y is when x is 3, what is x when y is 9? 3 5
what is the simplest square root of 1345? no decimals please
Fragment in this sentenceWith her heavy dictonary, Donna thumps the top other ancient computer monitor.  Whenever the color tint flickers from normal to sickly
What's a good slogan for a dietitian (have dietitian in it) ?
How did Alexander the Great rise to power and how did he spread Greek culture to other lands?
What sorts of signals does the brain use to communicate sensations, thoughts and actions?
the area of a triangle is 41 yards to the second power with a base of 5 yard what is the height in yard
How did the depression affect women and children?
Why did president Washington want the United States to remain neutral
sam cut a pie into equal parts.There are 3 slices left.The angle measures for 3 slices is 72.how many slices did he cut?