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

How do you work out the cross sectional area of a wire? I need to calculate the resistivity of a wire at certain lengths. I've calculated the resistance and
how are changes in the earth similar to changes in human beings
Simplify 1 5/3 2 6/3 3 2/9 4 18/1 5 6/27 6 9/12 7 28/7 8 13/10 9 16/27 10 3/18 11 4/32 Plzzzzz help
Which command is used to combine two or more cells together into one cell? A. Conditional Formatting B. Merge & Center C. Wrap Text D. Orientatio
What rule applies to this word? desire Group I. If the root is a full word, the ending is usually -able. Group II. When the root is a full word except for a f
PLEASE HELP ON NUMBER 5 I CANT FIGURE IT OUT!! DO TOMORROW
Which of these is the BIGGEST reason for the deforestation of the Amazon Rainforest?
What is the slope and y-intercept of the equation represented by the following graph?
If you're from africa then why are you white
In the number 3.333, the value of the digit in the hundredths place is ___ times as much as the digit in the thousandths place. Explain please.