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

Why did Al Gore challenge the Florida state law that set a deadline to certify election results
The figure below is made of two identical triangular prisms. What is the volume
a new car worth $25,000 is depreciating in value by $5,000 per year. After how many years will the cars value be 5,000
Someone please help me !!!
red gives a audience what feeling ?
helppppppppppppppp pleaseeeee
Which law could you use to simplify the expression (x^4)^9
Which of these is an advantage of an mri over an x-ray A. It requires large equipment. B.it uses no radiation C. It produces better image of a hard tissue D.I
At a movie theater, the size of popcorn bags decrease 20%. If the old bags held 15 cups of popcorn, how much do the new bags hold? Using double number lines
Ms. Olsen has 1 8 acre of land divided into 6 equal parts. What is the size of each part? A) 1 2 acre B) 1 14 acre C) 3 4 acre D) 1 48 acre