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

Subtract. Write your answer as a mixed number in simplest form. 8 1/8 - 3 3/8
Multiply. 8.2⋅4.3 Enter your answer in the box. 63 points no links!
1. What is the slope of a line that is perpendicular to the line represented by the equation 3x + 4y = 12? A. 3/4 B. -4/3 C. 4/3 D. -3/4
Review 1. The combustion efficiency of a non-weather- ized oil furnace must be at least
PLZZ HELP OTS A TIMED TEST Choose the reaction type for the following. 2Na2O → 4Na + O2
what is the longest word in english
(1) The reaction of tin (II) oxide with nitric acid.
Hi can someone solve the inequalities?8y - 5 < 33p + 2 > -10-2 > m/6 -7​
Which answer best describes the experience of Chinese immigrants working on the Central Pacific railroad? O They worked hard, but the railroad company paid ther
which of the following CANNOT be folded into a cube without any overlapping and gaps?