Question: Consider a simple Haskell Program that calculates the number of people infected with Covid-19 given an initial population, initial infections, infection rate, and number days
Consider a simple Haskell Program that calculates the number of people infected with Covid-19 given an initial population, initial infections, infection rate, and number days to calculate. Executing the program might look something like: arguments: [(days, uninfected, infections)] infectionRate diseaseStep [(3, 990, 10)] 0.05 => [(3, 990, 10), (2, 940, 60), (1, 893, 107), (0, 846, 152)] Sketch out the design of the above diseaseStep function in Haskell. You do not have to program this function, but the solution should be reasonably appropriate, readable, and recognizable as a Haskell program. You should implement the diseaseStep function in two parts base case and a recursive case.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
