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

what is the consequence if an essential amino acis is missing in the diet?​
The LCM of two prime numbers x and y (x>y) is 161. Find the remainder when x is divided by y. Answer
A ship has a 15-foot-tall mast with a 37.13-foot-long rope that is strung from the top of the mast to the ship's deck. What is the angle of elevation to the top
What child labor was like during the progressive era? What laws exist today to protect child workers? Evidence from other countries that shows how child labor h
I NEED HELP AS SOON AS POSSIBLE 25 POINTS AND BRAINLIEST
Please Help! I guessed on these questions and I don’t how they are correct! Does anybody know?
The Allied Taxi Company charges $2.50 to pick up a passenger and then adds $1.95 per mile. Isaac was charged $27.46 to go from one city to another. If x represe
Please help me in my English!
use the unit circle to find the value of tan (225 degrees
it is about work, energy.​