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 range of f(x) = (3/4)^x – 4?
read this sentence: after five years of working the same fast food job, paul overcame his inertia and started applying for better jobs. based on the sentence, w
what is 670.1 million km in scientific notation
dog chases a cat in a circle around the base of a tree. if the velocity of the dog is 0.35 m/s and the radius of the circle is 0.75 m, what is the centripetal a
registering to vote as a member of the republican party permits you to vote in a democratic primary election in a closed primary state prohibits you from voting
which german city became germanys banking center
trevor tutors french for $15 and hour and scoops ice cream for $10 an hour. he is going to work 15 hours this week. at least how many hours does he need to tuto
Examples of cliche in true grit
when did dalton form his atomic theory?
tom has a collection of 30 cds and nita has a collection of 18 cds. tom is adding 1 cd a month to his collection while nita is adding 5 cds a month to her colle