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

the wires inside a cable each have there own plastic insulation .why does the insulasion have diffrent colours
there tiger barbs in a 15 gallon aquarium and giant dani is in a 30 gallon aquarium.what numerical expression to represent the greatest total number of fish tha
Where does the irrational number 1.8693… fall?
A car traveling in a straight line has a velocity of 3.79 m/s at some instant. After 5.4 s, its velocity is 11.9 m/s. What is its average acceleration in this t
In an autocracy, what kind of power does the leader hold?
Predict what would happen to a plant with a genetic defect that produced no central vacuole.
Number pattern 1,1,2,6,24,120
a beaker with water and the surrounding air are all at 24'C. after ice cubes are placed in the water, heat is transfered from
add or subtract mentally 16.9+ 12.1
World War II was one of the most significant events of the 1900s and one of the most important events in US history. Think about how much the United States chan