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

Whose sole function is to provide humanitarian aid around the world
Which is an accurate description of the northern hemisphere at the time of the summer solstice? A. The hemisphere is tilted toward the sun and the sun reaches
Which statements describing how Renaissance ideas spread beyond Italy are true? Choose all answers that are correct. A. Writers such as Machiavelli and Castigli
Whose sole function is to provide humanitarian aid around the world
Find the circumference and area of a circle with a diameter of 22 inches. Leave your answers in terms of pi.
Compare 0.35 and 7/20
The most common foot in English poetry is the _____. iamb trochee anapest dactyl spondee
what is the science name for table salt
Why were Civil Rights leaders the main supporters of President Johnson's Great Society program? The program was focused on environmental issues. The program was
round 8.373 to the nearest hundredth