forked from matkatmusic/PFMCPP_Project5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLargestFiveCities.cpp
More file actions
36 lines (30 loc) · 958 Bytes
/
Copy pathLargestFiveCities.cpp
File metadata and controls
36 lines (30 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include "LargestFiveCities.h"
LargestFiveCities::LargestFiveCities()
{
std::cout << "LargestFiveCities being constructed." << std::endl;
}
LargestFiveCities::~LargestFiveCities()
{
std::cout << "LargestFiveCities being deconstructed." << std::endl;
}
void LargestFiveCities::setNames(std::string a, std::string b, std::string c, std::string d, std::string e)
{
cityA.name = a;
cityB.name = b;
cityC.name = c;
cityD.name = d;
cityE.name = e;
std::cout << "The largest cities are " << a << ", " << b << ", " << c << ", " << d << ", and " << e << "." << std::endl;
}
int LargestFiveCities::setPopulations(int a, int b, int c, int d, int e)
{
cityA.population = a;
cityB.population = b;
cityC.population = c;
cityD.population = d;
cityE.population = e;
int sum = a + b + c + d + e;
std::cout << "Combined population is " << sum << std::endl;
return sum;
}