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 u do narrower to broader
To finance her community college education, Sarah takes out a loan for $2900. After a year Sarah decides to pay off the interest, which is 4% of $2900. How much
Choose the correct definition for un conocido. A. a comic strip   B. an acquaintance   C. a coincidence   D. an avalanche
PLEASEEEE HELP MEEE!!!! Based on the data in your tables, did the light-colored moths have a higher or lower survival rate after the Industrial Revolution?
What is the point slope form of a line with slope -5 that contains point (2,-1)
If there are 3.281 feet in 1 meter, how many inches are in one centimeter
The following scenario is an example of which step in the five-step model of communication? Pablo: "Guess who I just ran into!" A)feedforward B)business C)
ian is in training for a national hot dog eating contest on the 4th of july. on his first day of training, he eats 4 hot dogs. each day, he plans to eat 110% of
hamlet act 1 what advice does polonius give his son, laertes?
I really need help on this