computer sicence short lab work Writing homework help

Organizational Change memo management homework help
March 4, 2023
Combat injuries in 1776 history homework help
March 4, 2023

computer sicence short lab work Writing homework help

Lab 6

Problem 1:
Write a program that:
1. Asks the user to enter a size of an array
2. Asks the user to enter a certain number of integers, based on the entered array size, separated by space
3. Stores them using a pointer to a dynamically allocated array of integers.
4. Then the program should print out the integers to the screen and print the average of even numbers and the average of odd numbers
Note: 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:
o string countryCode;
o int population;
o int callCode;
• Public:
o Country(string countryCode, int population, int callCode);
o string getCountryCode();
o int getCallCode();
o int getPopulation();
Write a program that:
1. Asks the user to enter a number of countries he wants to enter the data for
2. Asks 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 that
3. Enter each instance in a vector of Country*
4. Sort the vector of Country* based on the population
5. Display the countries’ data in descending order of their population

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers