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

Please help 15 POINTS!! Problem below
Where does trumbell use personification? For what purpose does he use this technique?
based on the context of each quote from my bondage and my freedom by frederick douglass, find the word that most closely matches the denomination of the bolder
suppose you earn $866.00 a month you are given a 15% raise. how much will you make a month now
Which strategy is BEST to employ and you are in the drafting phase? A) make sure you cite your sources correctly as you write. B) Write your ideas as caref
Mrs. Carson pays kristin $48 for babysitting 6 hours, and mr. Vasquez pats her $67.50 for babysitting 9 hours. Who pays kristin the better salary? Explain your
evaluate the expression 4x^2-2 when x=3
in the battle of gettysburg how did lee hope to protect pickett’s charge
9[-4]-3= plz help me 5 pontss
How long does It take for the sound of thunder to travel at 1485 m? Need answer ASAP!!