SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Implement a program that manipulates population information about American states (name,
capital, population). Program Description: Your program must be able to perform the following
operations: Store the state information from an external file into an array (of struts). Display all
state information. Sort the state information array, by state name. Sort the state information
array, by population. Display states whose population is less than 5 million. Display states whose
population is greater than 10 million. Estimated state populations as of 2000 A complete
program to perform the manipulations described above. Output to demonstrate that your program
behaves properly. An programming log that describes the time required to implement your
program.
Solution
#include 02 #include 03 04 int comp_pop(float start, float end); 05 06 int main() 07 { 08 //
Floats 09 float start, end; 10 printf("Please input the start population and ending population
of your city: "); 11 scanf("%f %f", &start, &end); // Collected as floats 12 13 // Returns
integer which fits %d specifier 14 printf("It will take %d years to reach desired population ",
comp_pop(start, end)); 15 return 0; 16 } 17 18 // Notice we have return type integer and
parameters which are float 19 int comp_pop(float start, float end) 20 { 21 int j = 0; 22
while(start < end) 23 { 24 start *= 1.1; 25 j++; 26 } 27 return j; 28 }

Weitere ähnliche Inhalte

Ähnlich wie Implement a program that manipulates population information about Amer.docx

Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxrajkumar490591
 
Cmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletCmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletPoppinss
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysisVishal Singh
 
(1) Learn to create class structure in C++(2) Create an array of.docx
(1) Learn to create class structure in C++(2) Create an array of.docx(1) Learn to create class structure in C++(2) Create an array of.docx
(1) Learn to create class structure in C++(2) Create an array of.docxgertrudebellgrove
 
Computing and Data Analysis for Environmental Applications
Computing and Data Analysis for Environmental ApplicationsComputing and Data Analysis for Environmental Applications
Computing and Data Analysis for Environmental ApplicationsStatistics Assignment Help
 
data.txtInternational Business Management l2 Cons.docx
data.txtInternational Business Management       l2        Cons.docxdata.txtInternational Business Management       l2        Cons.docx
data.txtInternational Business Management l2 Cons.docxtheodorelove43763
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semKavita Dagar
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 

Ähnlich wie Implement a program that manipulates population information about Amer.docx (20)

C Basics
C BasicsC Basics
C Basics
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
 
UNIT-I-TS&F.pptx
UNIT-I-TS&F.pptxUNIT-I-TS&F.pptx
UNIT-I-TS&F.pptx
 
Cmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutletCmis 102 hands on/tutorialoutlet
Cmis 102 hands on/tutorialoutlet
 
8085labmanual.pdf
8085labmanual.pdf8085labmanual.pdf
8085labmanual.pdf
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysis
 
(1) Learn to create class structure in C++(2) Create an array of.docx
(1) Learn to create class structure in C++(2) Create an array of.docx(1) Learn to create class structure in C++(2) Create an array of.docx
(1) Learn to create class structure in C++(2) Create an array of.docx
 
C programming
C programmingC programming
C programming
 
Computing and Data Analysis for Environmental Applications
Computing and Data Analysis for Environmental ApplicationsComputing and Data Analysis for Environmental Applications
Computing and Data Analysis for Environmental Applications
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
data.txtInternational Business Management l2 Cons.docx
data.txtInternational Business Management       l2        Cons.docxdata.txtInternational Business Management       l2        Cons.docx
data.txtInternational Business Management l2 Cons.docx
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
C programming
C programmingC programming
C programming
 
CalculateLoanPayments
CalculateLoanPaymentsCalculateLoanPayments
CalculateLoanPayments
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 

Mehr von tristans3

In a symmetric multiprocessor configuration- AH processors can perform.docx
In a symmetric multiprocessor configuration- AH processors can perform.docxIn a symmetric multiprocessor configuration- AH processors can perform.docx
In a symmetric multiprocessor configuration- AH processors can perform.docxtristans3
 
In consumer behavior we discussed innovators- opinion leaders- and mar.docx
In consumer behavior we discussed innovators- opinion leaders- and mar.docxIn consumer behavior we discussed innovators- opinion leaders- and mar.docx
In consumer behavior we discussed innovators- opinion leaders- and mar.docxtristans3
 
In chapter 2- 5 objectives of memory management were discussed- In Cha.docx
In chapter 2- 5 objectives of memory management were discussed- In Cha.docxIn chapter 2- 5 objectives of memory management were discussed- In Cha.docx
In chapter 2- 5 objectives of memory management were discussed- In Cha.docxtristans3
 
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docx
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docxIn certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docx
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docxtristans3
 
In c- Topic pointers Why do they call it dereferencing- As in derefer.docx
In c- Topic pointers  Why do they call it dereferencing- As in derefer.docxIn c- Topic pointers  Why do they call it dereferencing- As in derefer.docx
In c- Topic pointers Why do they call it dereferencing- As in derefer.docxtristans3
 
In C++ a function used to put data into a stack is typically called a.docx
In C++ a function used to put data into a stack is typically called a.docxIn C++ a function used to put data into a stack is typically called a.docx
In C++ a function used to put data into a stack is typically called a.docxtristans3
 
In an alternative universe- all rules governing quantum numbers and th.docx
In an alternative universe- all rules governing quantum numbers and th.docxIn an alternative universe- all rules governing quantum numbers and th.docx
In an alternative universe- all rules governing quantum numbers and th.docxtristans3
 
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docx
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docxIn a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docx
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docxtristans3
 
In a Classical model of the macroeconomy- the equilibrating mechanism.docx
In a Classical model of the macroeconomy- the equilibrating mechanism.docxIn a Classical model of the macroeconomy- the equilibrating mechanism.docx
In a Classical model of the macroeconomy- the equilibrating mechanism.docxtristans3
 
In 2012- Shurtleff estimates that warranty costs in the following year.docx
In 2012- Shurtleff estimates that warranty costs in the following year.docxIn 2012- Shurtleff estimates that warranty costs in the following year.docx
In 2012- Shurtleff estimates that warranty costs in the following year.docxtristans3
 
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docx
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docxIn 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docx
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docxtristans3
 
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docx
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docxIn 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docx
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docxtristans3
 
Impulse and momentum are two two different parameters- Explain these p.docx
Impulse and momentum are two two different parameters- Explain these p.docxImpulse and momentum are two two different parameters- Explain these p.docx
Impulse and momentum are two two different parameters- Explain these p.docxtristans3
 
Implementation of EHR Discuss the advantages and disadvantages associa.docx
Implementation of EHR Discuss the advantages and disadvantages associa.docxImplementation of EHR Discuss the advantages and disadvantages associa.docx
Implementation of EHR Discuss the advantages and disadvantages associa.docxtristans3
 
Implementing a new AIS system could prove to be beneficial or detrimen.docx
Implementing a new AIS system could prove to be beneficial or detrimen.docxImplementing a new AIS system could prove to be beneficial or detrimen.docx
Implementing a new AIS system could prove to be beneficial or detrimen.docxtristans3
 
Im creating a stack class using generics- what should my peek method l.docx
Im creating a stack class using generics- what should my peek method l.docxIm creating a stack class using generics- what should my peek method l.docx
Im creating a stack class using generics- what should my peek method l.docxtristans3
 
ii)State whether you would expect the following Group 13 metal cations.docx
ii)State whether you would expect the following Group 13 metal cations.docxii)State whether you would expect the following Group 13 metal cations.docx
ii)State whether you would expect the following Group 13 metal cations.docxtristans3
 
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docx
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docxIMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docx
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docxtristans3
 
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docxtristans3
 
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docxtristans3
 

Mehr von tristans3 (20)

In a symmetric multiprocessor configuration- AH processors can perform.docx
In a symmetric multiprocessor configuration- AH processors can perform.docxIn a symmetric multiprocessor configuration- AH processors can perform.docx
In a symmetric multiprocessor configuration- AH processors can perform.docx
 
In consumer behavior we discussed innovators- opinion leaders- and mar.docx
In consumer behavior we discussed innovators- opinion leaders- and mar.docxIn consumer behavior we discussed innovators- opinion leaders- and mar.docx
In consumer behavior we discussed innovators- opinion leaders- and mar.docx
 
In chapter 2- 5 objectives of memory management were discussed- In Cha.docx
In chapter 2- 5 objectives of memory management were discussed- In Cha.docxIn chapter 2- 5 objectives of memory management were discussed- In Cha.docx
In chapter 2- 5 objectives of memory management were discussed- In Cha.docx
 
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docx
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docxIn certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docx
In certain chlorophyll cofactors the Mg2+ is axially coordinated by th.docx
 
In c- Topic pointers Why do they call it dereferencing- As in derefer.docx
In c- Topic pointers  Why do they call it dereferencing- As in derefer.docxIn c- Topic pointers  Why do they call it dereferencing- As in derefer.docx
In c- Topic pointers Why do they call it dereferencing- As in derefer.docx
 
In C++ a function used to put data into a stack is typically called a.docx
In C++ a function used to put data into a stack is typically called a.docxIn C++ a function used to put data into a stack is typically called a.docx
In C++ a function used to put data into a stack is typically called a.docx
 
In an alternative universe- all rules governing quantum numbers and th.docx
In an alternative universe- all rules governing quantum numbers and th.docxIn an alternative universe- all rules governing quantum numbers and th.docx
In an alternative universe- all rules governing quantum numbers and th.docx
 
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docx
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docxIn a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docx
In a nonpolar covalent bond--- Electrons are shared unevenly Electrons.docx
 
In a Classical model of the macroeconomy- the equilibrating mechanism.docx
In a Classical model of the macroeconomy- the equilibrating mechanism.docxIn a Classical model of the macroeconomy- the equilibrating mechanism.docx
In a Classical model of the macroeconomy- the equilibrating mechanism.docx
 
In 2012- Shurtleff estimates that warranty costs in the following year.docx
In 2012- Shurtleff estimates that warranty costs in the following year.docxIn 2012- Shurtleff estimates that warranty costs in the following year.docx
In 2012- Shurtleff estimates that warranty costs in the following year.docx
 
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docx
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docxIn 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docx
In 2000- June- A 75-year-old widow- creates an irrevocable trust namin.docx
 
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docx
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docxIn 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docx
In 2007- Heuy-'s actual income was $70-000- equal to his lifetime annu.docx
 
Impulse and momentum are two two different parameters- Explain these p.docx
Impulse and momentum are two two different parameters- Explain these p.docxImpulse and momentum are two two different parameters- Explain these p.docx
Impulse and momentum are two two different parameters- Explain these p.docx
 
Implementation of EHR Discuss the advantages and disadvantages associa.docx
Implementation of EHR Discuss the advantages and disadvantages associa.docxImplementation of EHR Discuss the advantages and disadvantages associa.docx
Implementation of EHR Discuss the advantages and disadvantages associa.docx
 
Implementing a new AIS system could prove to be beneficial or detrimen.docx
Implementing a new AIS system could prove to be beneficial or detrimen.docxImplementing a new AIS system could prove to be beneficial or detrimen.docx
Implementing a new AIS system could prove to be beneficial or detrimen.docx
 
Im creating a stack class using generics- what should my peek method l.docx
Im creating a stack class using generics- what should my peek method l.docxIm creating a stack class using generics- what should my peek method l.docx
Im creating a stack class using generics- what should my peek method l.docx
 
ii)State whether you would expect the following Group 13 metal cations.docx
ii)State whether you would expect the following Group 13 metal cations.docxii)State whether you would expect the following Group 13 metal cations.docx
ii)State whether you would expect the following Group 13 metal cations.docx
 
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docx
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docxIMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docx
IMF in Greece- Good or bad for the country- Why-SolutionIMF is interna.docx
 
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx
2- What is a colloid- Why is it difficult to filter a colloid- 3- What.docx
 
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx
2- The Mars Climate Orbiter (formerly the Mars Surveyor 98 Orbiter) wa.docx
 

Kürzlich hochgeladen

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
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
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Kürzlich hochgeladen (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
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
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Implement a program that manipulates population information about Amer.docx

  • 1. Implement a program that manipulates population information about American states (name, capital, population). Program Description: Your program must be able to perform the following operations: Store the state information from an external file into an array (of struts). Display all state information. Sort the state information array, by state name. Sort the state information array, by population. Display states whose population is less than 5 million. Display states whose population is greater than 10 million. Estimated state populations as of 2000 A complete program to perform the manipulations described above. Output to demonstrate that your program behaves properly. An programming log that describes the time required to implement your program. Solution #include 02 #include 03 04 int comp_pop(float start, float end); 05 06 int main() 07 { 08 // Floats 09 float start, end; 10 printf("Please input the start population and ending population of your city: "); 11 scanf("%f %f", &start, &end); // Collected as floats 12 13 // Returns integer which fits %d specifier 14 printf("It will take %d years to reach desired population ", comp_pop(start, end)); 15 return 0; 16 } 17 18 // Notice we have return type integer and parameters which are float 19 int comp_pop(float start, float end) 20 { 21 int j = 0; 22 while(start < end) 23 { 24 start *= 1.1; 25 j++; 26 } 27 return j; 28 }