Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

#include #include using namespace std; class City { public: void ReadSizeAndName(); void Print() const; private: int size; string name; }; void City::ReadSizeAndName() { cin >>

image text in transcribed

#include #include using namespace std;

class City { public: void ReadSizeAndName(); void Print() const; private: int size; string name; };

void City::ReadSizeAndName() { cin >> size; cin >> name; }

void City::Print() const { cout

int main() { unsigned int i; vector cityList; City currCity; int entryNumber;

/* Your code goes here */ just follow the default template do not change other code. for (i = 0; i Jump to level 1 Use cin to read integer entryNumber from input until the next entryNumber read is equal to 1. If entryNumber is not equal to 1, use currCity's ReadSizeAndName() to read the city's size and name from input and append currCity to vector cityList. Ex: If the input is: then the output is: City size: 4152, Name: Asaph City size: 3504, Name: Gillette City size: 4396, Name: Hum City size: 4888, Name: Yonder City size: 1478, Name: Glendo 1 3 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions