In a population, the birth rate and death rate are calculated as follows: Birth Rate= Number of Births + Population Death Rate Number of Deaths + Population For example, in a population of 100,000 that has 8,000 births and 6,000 deaths per year, Birth Rate = 8,000 ÷ 100,000 = 0.08 Death Rate = 6,000 ÷ 100,000 = 0.06 Design a Population class that stores a current population, annual number of births, and annual number of deaths for some geographic area. The class should allow these three values to be set in two ways: by passing arguments to a three- parameter constructor when a new Population object is created or by calling the setPopulation, setBirths, and setDeaths class member functions. The class should also have getBirth Rate and getDeathRate functions that compute and return the birth and death rates. Your program should properly use pointer data types where appropriate. Write a program that uses the Population class and illustrates its capabilities. Input Validation: If a population figure less than 2 is passed to the class, use a default value of 2. Population must be greater than zero. If a birth or death figure less than 0 is passed to the class, prompt user to type in a positive Sample Output: Enter total population: 100000 Enter annual number of births: 8000 Enter annnual number of deaths: 6000 Population Statistics 100000 0.080 0.060 Population: Birth Rate: Death Rate: Press any key to continue Enter total population: -1 Value must be greater than 0. Please re-enter: 1 Enter annual number of births: -1 Value cannot be negative. Please re-enter: 0 Enter annnual number of deaths: 1 Population Statistics Population: Birth Rate: Death Rate: Press any key to continue. 2 0.000 0.500 Points deducted will be at discretion of professor but all exams will be given the same grading consideration. Let's say 5 exams do not include any documentation/comments in the code, then same amount of points will be deducted on all 5 exams. Some tasks will carry more weight than other tasks. Read problem definition above and evaluate what programming concepts... (hint... the use of classes and objects... use of class functions, etc.)... in this case... will obviously carry more weight than adding, for example, comments/documentation to your programming code.
In a population, the birth rate and death rate are calculated as follows: Birth Rate= Number of Births + Population Death Rate Number of Deaths + Population For example, in a population of 100,000 that has 8,000 births and 6,000 deaths per year, Birth Rate = 8,000 ÷ 100,000 = 0.08 Death Rate = 6,000 ÷ 100,000 = 0.06 Design a Population class that stores a current population, annual number of births, and annual number of deaths for some geographic area. The class should allow these three values to be set in two ways: by passing arguments to a three- parameter constructor when a new Population object is created or by calling the setPopulation, setBirths, and setDeaths class member functions. The class should also have getBirth Rate and getDeathRate functions that compute and return the birth and death rates. Your program should properly use pointer data types where appropriate. Write a program that uses the Population class and illustrates its capabilities. Input Validation: If a population figure less than 2 is passed to the class, use a default value of 2. Population must be greater than zero. If a birth or death figure less than 0 is passed to the class, prompt user to type in a positive Sample Output: Enter total population: 100000 Enter annual number of births: 8000 Enter annnual number of deaths: 6000 Population Statistics 100000 0.080 0.060 Population: Birth Rate: Death Rate: Press any key to continue Enter total population: -1 Value must be greater than 0. Please re-enter: 1 Enter annual number of births: -1 Value cannot be negative. Please re-enter: 0 Enter annnual number of deaths: 1 Population Statistics Population: Birth Rate: Death Rate: Press any key to continue. 2 0.000 0.500 Points deducted will be at discretion of professor but all exams will be given the same grading consideration. Let's say 5 exams do not include any documentation/comments in the code, then same amount of points will be deducted on all 5 exams. Some tasks will carry more weight than other tasks. Read problem definition above and evaluate what programming concepts... (hint... the use of classes and objects... use of class functions, etc.)... in this case... will obviously carry more weight than adding, for example, comments/documentation to your programming code.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Concept explainers
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Question
Kindly solve in C++ language
Expert Solution
Step 1
The C++ program using above conditions with snippet of the code.
Step by step
Solved in 2 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education