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

When someone inhales large amounts of carbon monoxide, they can...
Sale 70% OFF! Gwen wants to buy a laptop computer. The original price is $720. What is the sale price?
all of the following are problems for marine organisms Except: turbulence, colder water, less sunlight, weaker currents
Function f is represented by f(x) = 5x+10Find f(-3)Find the value of x such that f(x) = 90 is true
Temperatures have fluctuated throughout history, so why are recent global warming trends such a concern for climate scientists? Today's global warming:A.is affe
Crime is never a choice - critically discuss. (just need basic idea points and theories)
What does the underlined phrase indicate about the author's feelings toward Frida Kahlo?
all of the following are problems for marine organisms Except: turbulence, colder water, less sunlight, weaker currents
a sentence explaining the significants of the word stock
a 9-pack of bracelets costs 7.65 what is the unit price