Write a program that will predict the size of a population


Problem

• Write a program that will predict the size of a population of organisms. The program should ask for the starting number of organisms, their average daily population increase (as a percentage), and the number of days they will multiply. For example, a population might begin with two organisms, have an average daily increase of 50 percent, and will be allowed to multiply for seven days. The program should use a for loop to display the size of the population for each day. So for the previous example, the output should look like:
Day Organisms

1 2.0
2 3.0
3 4.5
4 6.75
5 10.125
6 15.1875
7 22.78125

Input validation: Do not accept a number less than 2 for the staring size of the population. Do not accept a negative number for average percent daily population increase. Do not accept a number less than 1 for the number of days they will multiply.

• Write a program that takes user entered lines from the keyboard and stores them in an array. When the user enters "quit", the program prints out all the lines sorted (i.e. a line starting with a_n_ _"A_b_..." _w_o_u_l_d_ _p_r_i_n_t_ _o_u_t_ _b_e_f_o_r_e_ _o_n_e_ _s_t_a_r_t_i_n_g_ _w_i_t_h_ _"A_c_...")_._ _

• Now modify the program so it tells you how many lines have been entered, and then prints out only lines 2, 3, and 4.

• Write a program that asks the user to enter the number of calories and fat grams in a food item. The program should display the percentage of the calories that come from fat. One gram of fat has 9 calories, therefore:

Calories from fat = fat grams * 9

The percentage of calories from fat can be calculated as follows:

Calories from fat / total calories

The response must include a reference list. Using one-inch margins, double-space, Times New Roman 12 pnt font and APA style of writing and citations.

Solution Preview :

Prepared by a verified Expert
Python Programming: Write a program that will predict the size of a population
Reference No:- TGS03120285

Now Priced at $50 (50% Discount)

Recommended (93%)

Rated (4.5/5)