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

A detailed description of the money your business makes and expends every month for the first year is called a(n) A ) cash-flow statement. B ) income stateme
During the Battle of the Bulge, U.S. forces were: A. pushed back by German forces. B. able to land troops during the D-Day invasion. C. able to liberate Paris f
Need help with this?
How do I summarize nonfiction?
A grant for students who are majoring in math or the sciences is called
A marker is 0.13 meters long. What is the length in millimeters?
Ben is buying a stereo that cost $899 if the sales tax rate is 4.5% how much tax will he have to pay on the stereo?plz help 22 points plz explain....give right
In parallelogram ABCD, m∠ADC = 60°. What is m∠DCB? ___°
Which type of an art or architecture from Egypt has been adopted by the US government
help me please 30pts