This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
public: | |
string name; | |
int populationCount; | |
void storeCountryInformation(string s, int n){ | |
name = s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
public: | |
string name; | |
int populationCount; | |
//Constructor | |
Country(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
public: | |
string name; | |
int populationCount; | |
//Parameterized Counstructor | |
Country(string s, int n){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
public: | |
string name; | |
int populationCount; | |
int *stateCount; | |
Country(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
public: | |
string name; | |
int populationCount; | |
static int countryCount; | |
void setCountryDetails(string s, int n){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
struct Country{ | |
string name; | |
int populationCount; | |
Country(string s, int n){ | |
name = s; | |
populationCount = n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
enum Direction {North, South, East, West} dir; | |
enum Gender {Male, Female}; | |
int main(){ | |
//Example 1 | |
dir = East; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
private: | |
string name; | |
int populationCount; | |
public: | |
Country(string s, int n){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class Country{ | |
private: | |
string name; | |
int populationCount; | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
class Person{ | |
private: | |
string name; | |
int age; | |
public: | |
Person(string name, int age): name{name}, age{age}{ |
OlderNewer