C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 8, Problem 7PP

(a)

Program Plan Intro

Program Plan: 

  • filename, population, totalCity, cityName, andmayor variables are used in the program.
  • c_str () andclose() functions are used in the program.

Program Description: The main purpose of the program is to create a file to store the collected information about the cities in your state. Prompt the user to enter the data of the each city’s name, their pollution, and the name of the mayor. Store the user-entered data in the file.

(b)

Program Plan Intro

Program Plan: 

  • filename, line, andcityInfovariables are used in the program.
  • getline (), fail (), c_str(), sort (), push_back (), eof (), close (),andexit () functions are used in the program.

Program Description: The main purpose of the program is to read the data from the file created in the exercise 7a. Sort the data in the alphabetically order by the city name.After sorting, display the data.

Blurred answer
Students have asked these similar questions
Using R language. Here is the information link. http://www.cnachtsheim-text.csom.umn.edu/Kutner/Chapter%20%206%20Data%20Sets/CH06PR18.txt
Using R language
How can I type the Java OOP code by using JOptionPane with this following code below: public static void sellCruiseTicket(Cruise[] allCruises) { //Type the code here }
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning