Please fill in the If function if they put in a negative value, and the esxtmated population per year. please use my code. im not sure how to fish it If P is the population of the first day of the year, B is the birth rate and D is the death rate, the estimated population at the end of the next year is given by formula: P + ( B * P ) / 100 – ( D * P ) / 100

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
icon
Related questions
icon
Concept explainers
Question

Please fill in the If function if they put in a negative value, and the esxtmated population per year. please use my code. im not sure how to fish it

If P is the population of the first day of the year, B is the birth rate and D is the death rate, the estimated population at the end of the next year is given by formula:

P + ( B * P ) / 100 – ( D * P ) / 100

The population growth rate is given by the formula: B - D


create a program that prompts the user to enter the starting population, birth and death rates and the number of years to project. The program should then calculate and print the growth rate and the estimated population after each year. Your program must contain the following functions:

GrowthRate: This function takes as its parameters the birth and death rates and returns the population growth rate.

Estimated Population: This function takes as its parameters the current population, the birth rate and the death rate. It returns the estimated population for the next year. Your program should not accept negative birth rate, negative death rate or population of less than 2.

 

X
Q
A Homework 1
Homework 1
C* main
+ ✓ Filter
Ex
U
A Homework 1
2:3
6
7
8
9
10
11
Homework 1) Homework 1) C* main > No Selection
//
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2782532444
26
29
30
31
33
36
39
40
41
46
Auto
#include <iostream>
int main()
{
C* main
using namespace std;
float getPop Rate (int, int);
float est Population (int birth_Rate, int population, int death_Rate);
}
}
int birth_Rate;
int population;
int death_Rate;
float popRate;
Homework 1 My Mac
cout<<"Enter the Birth Rate " << endl;
cin >> birth_Rate;
cout << "Enter the Population " << endl;
cin >>population;
cout << "Enter the Death Rate " << endl;
cin >> death_Rate;
popRate = getPop Rate (birth_Rate, death_Rate);
cout << "The Population Growth Rate is " << popRate << endl;
return 0;
float getPopRate (int birth_Rate, int death_Rate)
{
O
float popRate;
popRate birth_Rate - death_Rate;
return popRate;
→ Filter
All Output
Build Succeeded | Yesterday at 1:51 PM
→ Filter
← 20
H▬▬▬▬▬
--
H
Line: 37 Col: 1
EP
+
+
Identity and Type
Name main.cpp
Type Default - C++ Source
Relative to Group
main.cpp
Location
Full Path /Users/nick/Desktop/
Homework 1/Homework 1/
main.cpp
On Demand Resource Tags
Only resources are taggable
Target Membership
Homework 1
Text Settings
Text Encoding No Explicit Encoding
Line Endings No Explicit Line Endings
Indent Using Spaces
Widths
4
Tab
Wrap lines
Indent
A
4
C
↑
↑
Transcribed Image Text:X Q A Homework 1 Homework 1 C* main + ✓ Filter Ex U A Homework 1 2:3 6 7 8 9 10 11 Homework 1) Homework 1) C* main > No Selection // 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2782532444 26 29 30 31 33 36 39 40 41 46 Auto #include <iostream> int main() { C* main using namespace std; float getPop Rate (int, int); float est Population (int birth_Rate, int population, int death_Rate); } } int birth_Rate; int population; int death_Rate; float popRate; Homework 1 My Mac cout<<"Enter the Birth Rate " << endl; cin >> birth_Rate; cout << "Enter the Population " << endl; cin >>population; cout << "Enter the Death Rate " << endl; cin >> death_Rate; popRate = getPop Rate (birth_Rate, death_Rate); cout << "The Population Growth Rate is " << popRate << endl; return 0; float getPopRate (int birth_Rate, int death_Rate) { O float popRate; popRate birth_Rate - death_Rate; return popRate; → Filter All Output Build Succeeded | Yesterday at 1:51 PM → Filter ← 20 H▬▬▬▬▬ -- H Line: 37 Col: 1 EP + + Identity and Type Name main.cpp Type Default - C++ Source Relative to Group main.cpp Location Full Path /Users/nick/Desktop/ Homework 1/Homework 1/ main.cpp On Demand Resource Tags Only resources are taggable Target Membership Homework 1 Text Settings Text Encoding No Explicit Encoding Line Endings No Explicit Line Endings Indent Using Spaces Widths 4 Tab Wrap lines Indent A 4 C ↑ ↑
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education