vendredi 6 mars 2020

how to fixed this method quesiton?

A pneumonia outbreak ... 1. Infected people have an incubation period of two days. They will not be contagious during the incubation period and will only infect other people after they become ill. 2. Infected people can be transmitted to 2 people who have not been infected every day. 3. As long as you are infected, you will not be cured!   Suppose there is only one original person at the beginning. How many people will be infected after 20 days?

def infected(days)

end

puts infected(20)

Aucun commentaire:

Enregistrer un commentaire