Question
Write a C++ program that will read in a file of states and populations. When the program has read through the complete file, it will
Write a C++ program that will read in a file of states and populations. When the program has read through the complete file, it will display the following information: the state and population with the smallest population the state and population with the largest population the state name and population that would appear first in an ascending list the state name and population that would appear last in an ascending list the number of states listed in the input file the average population of the states listed in the input file The input file is named StateDemographics.txt and is located in the current directory. The input file consists of the name of the state on one line and its respective population on the next line. Do not store all the information from the input file. Only store the information listed above.
Colorado 5842076 Oregon 4283747 Texas 27469114 New Jersey 8791894 Wisconsin 5686986 New Hampshire 1359711 Virginia 8626210 Missouri 5988927 Georgia 3989167 Vermont 600412 South Dakota 899174 Washington 7656200
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started