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

Several geologic phenomena are being studied as signs of an impending volcanic eruption. These include seismic waves, ______________, and the release of gases.
What is the solution to this inequality? −16x<64 x<−4 x≥−4 x≤−4 x>−4
Mcbride transitions from the personal to the historical several times in ""hip hop planet. "" how does he achieve these transitions? what are some of the strate
Simplify. 15 X plus 2Y plus X plus 7X plus 8Y
what about an atom can we learn by studying the bohr model?
What is the easiest way to find the circumfrence
Express 12mm : 0.48m as a ratio in its simplest form
Compared with DNA replication, transcription is _______ error prone because of differences in _______.
Given f(x) = 4x2 + 2x - 6 What is the value of f(1/4)
A wheel accelerates from rest to 34.7 rad/s at a rate of 47.0 rad/s^2. Through what angle (in radians) did the wheel turn while accelerating?