Question: The function called A4Q2 returns the value of the following calculation: Multiply the argument x by 9, then raise the result to the power of

The function called A4Q2 returns the value of the following calculation: Multiply the argument x by 9, then raise the result to the power of 2.1. This checks your ability to convert programs and calculations in English into Java code. you can look up the documentation for pow

Take the function called A4Q3, which has been written for you. This function simulates the spread of a virus given an initial population of people and a reproduction rate R. The R rate is how many people each infected person will infect. So if the infection rate is 1.1 and the population is 200, the number of infected people will be 220. You have to make two additions to the code. Firstly you need to println every time the value of the infected people variable changes. If you print out 200 twice, then you have too many print statements. Secondly, when infected people get above 1 million, you must return the number of people infected. For example, if the number of people infected goes from 99,999 to 1,001,222, you must stop the function A4Q3 and return 1,001,222. [5]

The function called A4Q2 returns the value of the following calculation: Multiply

public int A4Q3 ( float rRate ) \{ int population =10; // your loop here population = (int) (population * rRate); // your loop here return population ; //

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!