Using a while loop calculate how many weeks it would take


Problem

1. Redo the previous two questions using while loops instead of for loops.

2. The variables rat_1_weight and rat_2_weight store the weights of two rats at the beginning of an experiment. The variables rat_1_rate and rat_2_rate are the rate that the rats' weights are expected to increase each week (for example, 4 percent per week).

a) Using a while loop, calculate how many weeks it would take for the weight of the first rat to become 25 percent heavier than it was originally.

b) Assume that the two rats have the same initial weight, but rat 1 is expected to gain weight at a faster rate than rat 2. Using a while loop, calculate how many weeks it would take for rat 1 to be 10 percent heavier than rat 2.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Using a while loop calculate how many weeks it would take
Reference No:- TGS02695381

Expected delivery within 24 Hours