Homework Solution: This assignment may contain elements we have not discussed, but we wil…

    C++ This assignment may contain elements we have not discussed, but we will in the coming days.
    1. Create a class called Country. It must contain 4 private attributes for the name of the country, total population (in millions), the greeting for "hello" in the native characters and spelling, and whether or not the country is mostly located in the western hemisphere. This class must contain ONLY a 4-arg constructor that will set the initial value for each attribute. Do NOT incluse a default constructor.
    2. Create only accessors for each attribute. If you wish, you may also create mutators, but we will not need them for this exercise.
    3. Create a function (NOT a method) that will take and array of Country and return the sum of total population of all Countries NOT in the western hemisphere. Call it sumPopEast(). It must accept the proper argument to process this array.
    4. Create a function (NOT a method) that will print the hello greeting of each Country in the array. Call it helloToAll().
    5. Create a function (not a method) that will return the greeting of the Country that contains the lowest population.
    6. Instantiate an array of at least 5 instances. One Country must be your native Country, at least two, must be located in the Eastern hemisphere and at least two from the Western. We will discuss how to do this. Do NOT use pointers for this assignment.
    Perfect submissions will include: A documentation section Properly commented code. A main function that properly shows the results of function calls. Other elements as discussed in class.

    Expert Answer

     
    Dear Student, here i have written the C++ program as per the requir

    C++

    This ordinance may include elements we bear referable attributable attributable attributable attributable attributable attributable examineed, still we accomplish in the future days.

    1. Engender a tabulate denominated Empire. It must include 4 individual marks coercion the cintegral of the empire, blend population (in millions), the fearlessness coercion “hello” in the exported characters and spelling, and whether or referable attributable attributable attributable attributable attributable attributable the empire is ce-the-most-part located in the western hemisphere. This tabulate must include ONLY a 4-arg maker that accomplish cemal the primal appreciate coercion each mark. Do NOT inclreason a lapse maker.
    2. Engender merely accessors coercion each mark. If you appetition, you may too engender mutators, still we accomplish referable attributable attributable attributable attributable attributable attributable scarcity them coercion this exertion.
    3. Engender a administration (NOT a arrangement) that accomplish confirm and decorate of Empire and revert the blend of blend population of integral Countries NOT in the western hemisphere. Cintegral it blendPopEast(). It must confirm the adapted controversy to rule this decorate.
    4. Engender a administration (NOT a arrangement) that accomplish stereomodel the hello fearlessness of each Empire in the decorate. Cintegral it helloToAll().
    5. Engender a administration (referable attributable attributable a arrangement) that accomplish revert the fearlessness of the Empire that includes the meanest population.
    6. Instantiate an decorate of at last 5 instances. One Empire must be your exported Empire, at last couple, must be located in the Eastern hemisphere and at last couple from the Western. We accomplish examine how to do this. Do NOT reason pointers coercion this ordinance.

    Perfect submissions accomplish include:

    A documentation section

    Rightly illustrateed adjudication.

    A ocean administration that adaptedly shows the results of administration calls.

    Other elements as examineed in tabulate.

    Expert Defense

     

    Dear Student,

    here i bear written the C++ program as per the requirement.I bear too inclueded the illustrate coercion improve intellect.

    —————————————————————————————————————————————-

    Note: Please referable attributable attributable attributable attributable attributablee that the adown program has been tested on ubuntu 16.04 order and compiled below g++ compiler. This adjudication accomplish too composition on other IDE’s and C++ microsoft visual studio specific.

    ——————————————————————————————————————————————

    Program:

    —————————————————————————————————————————————–

    //Header file

    #include<iostream>

    //namespace declration

    using callspace std;

    //calass declration

    tabulate Empire

    {

    //limb fickle declration

    private:

    string call;

    int population;

    string greet;

    char CH;

    public:

    //fickle facts model declration

    int i,l, blend = 0;

    //maker declration

    Country(string N, int P, string G, char C)

    {

    cintegral = N;

    population = P;

    greet = G;

    CH = C;

    }

    //creating accessors

    string cemalName(string S)

    {

    cintegral = S;

    }

    int cemalPopulation(int Pop)

    {

    population = Pop;

    }

    string cemalGreet(string Greet)

    {

    greet = Greet;

    }

    char cemalChar(char c)

    {

    CH = c;

    }

    //finding the blend of population

    int blendPopEast(int decorate[])

    {

    for(i=0; i< 5; i++)

    {

    blend = blend + decorate[i];

    }

    revert blend;

    }

    //limb administration helloToAll()

    string helloToAll(string arr1[], string arr2[])

    {

    for(i=0;i<5;++i)

    {

    cout<<arr2[i]<<” : “<<arr1[i]<<endl;

    }

    }

    //definition coercion the meanestPop administration

    int meanestPop(int decorate[])

    {

    int min = decorate[0];

    for(i=0;i< 5; i++)
    {

    if(array[i]<min)

    {

    min = decorate[i];

    l = i;

    }
    revert l;
    }

    }

    };

    //ocean administration

    int ocean()

    {

    //decorate primalizations

    string call[5] = {“India”, “Thailand”, “Kenya”, “USA”, “Portugal”};

    int L;

    int Pop[5] = {50, 5, 10, 20, 30};

    string Greet[] = {“Namste!”, “Wai!”, “Adamu!”, “Hello!”, “Hola”};

    char CH[5] = {‘N’, ‘Y’, ‘N’, ‘Y’, ‘Y’};

    //creatring maker object

    Empire C1(“India”, 100, “Hello”, ‘N’);

    //Calling the limb administrations

    cout<<“Blend of Population is : “<<C1.sumPopEast(Pop)<<endl;

    cout<<“Fearlessness of each empire is: “<<endl;

    //cout<<C1.helloToAll(Greet, call)<<endl;

    cout<<“Empire with the meanest population is: “<<endl;

    L = C1.lowestPop(Pop);
    cout<<name[L]<<endl;

    revert 0;

    }