dynamically allocated array of integers, computer science homework help
Problem 1: Write a program that: Asks the user to enter a size of an arrayAsks the user to enter a certain number of integers, based on the entered array size, separated by spaceStores them using a pointer to a dynamically allocated array of integers. Then the program should print out the integers to the screen and print the average of even numbers and the average of odd numbersNote: you can have averageEven(double a[ ], int size) and averageOdd(double a[ ], int size) as two functions that you invoke in your main method. Average of even numbers is the sum of even numbers divided by the number of even numbers in the array. Problem 2: Consider the class Country: Private:string countryCode;int population;int callCode;Public:Country(string countryCode, int population, int callCode); string getCountryCode(); int getCallCode(); int getPopulation();Write a program that: Asks the user to enter a number of countries he wants to enter the data forAsks the user to enter the details of each country in a line separated by spaces (country code, population, call code) and create a dynamically allocated instance of Country based on thatEnter each instance in a vector of Country*Sort the vector of Country* based on the populationDisplay the countries’ data in descending order of their population
THIS QUESTION IS UNSOLVED!
Request a custom answer for this question