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 chemical formula for zinc carbonate?(1) ZnCO3 (2) Zn(CO3)2 (3) Zn2CO3 (4) Zn3CO3
9 (a) Work out the value of 5c – d when c = 3 and d = 7
The two forms of oxygen, O2(g) and O3(g), have (1) different molecular structures and identical properties (2) different molecular structures and different prop
Why did Athena like Odysseus so much?
The bond between Br atoms in a Br2 molecule is (1) ionic and is formed by the sharing of two valence electrons (2) ionic and is formed by the transfer of two va
Find the sum of -4 and 14
m=k/s solve for k Answer choices K=m/s K=ms K=s/m K=m+s
what is the root of irrelevant
Arsenic is often obtained by heating the ore arsenopyrite, FeAsS. The decomposition of FeAsS is represented by the balanced equation below. FeAsS(s) ==heat==>
What is the average weight of the human eyeball?