Answer to Question #336208 in C# for Siyanda

Question #336208

a) Write a method PopulationTotal that accepts 2 positive values, namely the current

population (in millions, e.g. a value of 1.5 means 1.5 million people) and the growth rate (e.g.

0.14 means 14%). The method determines and returns the total population based on the current

population and growth rate. For example, if the current population for a country is 1.165 million

people, and the annual population growth rate is 10%, then the total population is 1.2815 million

people after 1 year.

b) Write a method Over180Million that accepts a positive value representing the population (in

millions). The method determines whether the population is over 180 million people, and returns

a value of true if this is so, otherwise returns a value of false.


1
Expert's answer
2022-05-01T19:05:39-0400
        public static double PopulationTotal(double cur_pop, double gr_rate)
        {
            return (cur_pop + cur_pop * gr_rate);    
        }

        public static bool Over180Million(double pop)
        {
            if (pop > 180)
                return true;
            else
                return false;
        }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS