SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Please code the following in c++ language.
create a program that reads in the population of five districts into an array, and the growth rate of
each district. then apply the growth rate to the population and print the new population sizes and
total population.
Solution
#include<iostream>
using namespace std;
int main() {
int population[5],growthRate[5],totalpop=0;
for(int i=0;i<5;i++)
{
cout<<" Enter Population for District "<<i+1<<": ";
cin>>population[i];
cout<<" Enter Growth Rate for District "<<i+1<<": ";
cin>>growthRate[i];
}
cout<<"  ";
for(int i=0;i<5;i++)
{
totalpop+=population[i]*growthRate[i];
cout<<" New Population for District "<<i+1<<" is: "<<population[i]*growthRate[i];
}
cout<<"  Total Population = "<<totalpop;
return 0;
}
output:
Enter Population for District 1: 10
Enter Growth Rate for District 1: 2
Enter Population for District 2: 20
Enter Growth Rate for District 2: 2
Enter Population for District 3: 30
Enter Growth Rate for District 3: 3
Enter Population for District 4: 40
Enter Growth Rate for District 4: 2
Enter Population for District 5: 50
Enter Growth Rate for District 5: 2
New Population for District 1 is: 20
New Population for District 2 is: 40
New Population for District 3 is: 90
New Population for District 4 is: 80
New Population for District 5 is: 100
Total Population = 330
RUN SUCCESSFUL (total time: 54s)

Weitere ähnliche Inhalte

Ähnlich wie Please code the following in c++ language- create a program that reads.docx

In C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxIn C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxtristans3
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in CSaket Pathak
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentalsZaibi Gondal
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++cpjcollege
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codepradesigali1
 
C program report tips
C program report tipsC program report tips
C program report tipsHarry Pott
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)Make Mannan
 
LAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfLAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfRavinReddy3
 
The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]CARTO
 
prathamesh .ppt 1.pptx
prathamesh  .ppt 1.pptxprathamesh  .ppt 1.pptx
prathamesh .ppt 1.pptxakashgorade1
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignmentSaket Pathak
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notesSrikanth
 
Labsheet 6 - FP 201
Labsheet 6 - FP 201Labsheet 6 - FP 201
Labsheet 6 - FP 201rohassanie
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5nancydrews
 

Ähnlich wie Please code the following in c++ language- create a program that reads.docx (20)

C-LOOP-Session-2.pptx
C-LOOP-Session-2.pptxC-LOOP-Session-2.pptx
C-LOOP-Session-2.pptx
 
In C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxIn C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docx
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
 
C program report tips
C program report tipsC program report tips
C program report tips
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
LAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfLAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdf
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
 
The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]
 
prathamesh .ppt 1.pptx
prathamesh  .ppt 1.pptxprathamesh  .ppt 1.pptx
prathamesh .ppt 1.pptx
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
 
Labsheet 6 - FP 201
Labsheet 6 - FP 201Labsheet 6 - FP 201
Labsheet 6 - FP 201
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5
 

Mehr von ellenj4

The function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docxThe function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docxellenj4
 
The four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docxThe four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docxellenj4
 
The IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docxThe IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docxellenj4
 
The Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docxThe Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docxellenj4
 
The internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docxThe internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docxellenj4
 
The Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docxThe Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docxellenj4
 
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docxThe Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docxellenj4
 
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docxThe Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docxellenj4
 
The following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docxThe following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docxellenj4
 
The following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docxThe following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docxellenj4
 
The following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docxThe following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docxellenj4
 
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docxThe German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docxellenj4
 
The graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docxThe graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docxellenj4
 
The general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docxThe general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docxellenj4
 
The general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docxThe general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docxellenj4
 
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docxThe functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docxellenj4
 
The following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docxThe following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docxellenj4
 
The G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docxThe G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docxellenj4
 
Please do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docxPlease do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docxellenj4
 
Please describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docxPlease describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docxellenj4
 

Mehr von ellenj4 (20)

The function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docxThe function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docx
 
The four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docxThe four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docx
 
The IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docxThe IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docx
 
The Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docxThe Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docx
 
The internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docxThe internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docx
 
The Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docxThe Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docx
 
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docxThe Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
 
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docxThe Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
 
The following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docxThe following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docx
 
The following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docxThe following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docx
 
The following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docxThe following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docx
 
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docxThe German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
 
The graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docxThe graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docx
 
The general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docxThe general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docx
 
The general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docxThe general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docx
 
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docxThe functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
 
The following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docxThe following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docx
 
The G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docxThe G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docx
 
Please do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docxPlease do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docx
 
Please describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docxPlease describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docx
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Kürzlich hochgeladen (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Please code the following in c++ language- create a program that reads.docx

  • 1. Please code the following in c++ language. create a program that reads in the population of five districts into an array, and the growth rate of each district. then apply the growth rate to the population and print the new population sizes and total population. Solution #include<iostream> using namespace std; int main() { int population[5],growthRate[5],totalpop=0; for(int i=0;i<5;i++) { cout<<" Enter Population for District "<<i+1<<": "; cin>>population[i]; cout<<" Enter Growth Rate for District "<<i+1<<": "; cin>>growthRate[i]; } cout<<" "; for(int i=0;i<5;i++) { totalpop+=population[i]*growthRate[i]; cout<<" New Population for District "<<i+1<<" is: "<<population[i]*growthRate[i]; } cout<<" Total Population = "<<totalpop; return 0; } output: Enter Population for District 1: 10
  • 2. Enter Growth Rate for District 1: 2 Enter Population for District 2: 20 Enter Growth Rate for District 2: 2 Enter Population for District 3: 30 Enter Growth Rate for District 3: 3 Enter Population for District 4: 40 Enter Growth Rate for District 4: 2 Enter Population for District 5: 50 Enter Growth Rate for District 5: 2 New Population for District 1 is: 20 New Population for District 2 is: 40 New Population for District 3 is: 90 New Population for District 4 is: 80 New Population for District 5 is: 100 Total Population = 330 RUN SUCCESSFUL (total time: 54s)