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

How do I change 36 to 360
what is 15.70796327 rounded to 1 decimal point?
How are continental volcanoes formed?
What is the meaning of open proportion?
can you simplify 25/4? if so, how?
can someone help me on this question! please! :)Evaluate the formula V= BH/3; B = 36 in.² and h = 11 in.
How are continental volcanoes formed?
What's needed to know Right now we are doing unit 1 which is about tensions in ropes and weight and stuff about newtons. We are taking a test tomorrow and I st
What two numbers has a lcm of 50
The length of Marshall's poster is 2 times its width. If the perimeter is 72 inches, what is the area of the poster?