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

North Africa and Italy both border the what? a. Mediterranean Sea. b. Red Sea. c. Persian Gulf. d. Caspian Sea.
If the inflation rate increases faster than their income, people will most likely
True or False: A flame test can be used to identify the presence of certain elements in a compound?
Which algae are responsible for causing red tides that can kill thousands of fish? Chlorophyta Rhodophyta Phaeophyta Pyrrophyta
If each number is rounded to the nearest whole number, which statement is true? A = 6.9 + 8.3 B = 6.2 + 8.5 A = B A < B A > B
The majority of Portugal's colonies in Africa were located in Eastern Africa. a. True b. False
The sum of three consecutive integers is 42. Let x be the middle of the three integers.
who was the only u.s president that got elected twice
martian periodic table
a shopper bought a 15 pound bag of oranges for $23.25 what was the unit price