Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to get this done! Population Class-Write a class called Population that stores current population, annual number of births, and an annual number of deaths

image text in transcribed

image text in transcribed

how to get this done!

Population Class-Write a class called Population that stores current population, annual number of births, and an annual number of deaths for some geographic area with the following specifications: Member Variables - Private Integers to store the current population, number of births, and number of deaths Member Functions Public Default Constructor with no parameters: Initialize Population to 2 and number of births and deaths to 0. Constructor with three parameters. The constructor should be passed the current population, number of births, and number of deaths for the Population object "Set" member function for each of the three member variables. 2 is passed to the class, use a default value of 2. If a birth or death figure less than 0 is passed use a default value of 0. getBirthrate member function. This function should calculate Birthrate based on the following formula: 1. 2. 3. If a population figure less than 4. a. Birth rate Number of Births / Population getDeathrate member function. This function should calculate Birthrate based on the following formula 5. a. Death rate Number of Deaths/ Population Note: As noted in the textbook, generally it is best not to do any input or output in member functions. Testing Write a main function to test your class. Be sure that your output shows that each of your member functions works. Be sure to test with invalid as well as valid data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago