Define a class country that stores the name of the country


Program 1

Define a class Country that stores the name of the country, its population, and its area. Using that class, write a program that reads in a set of countries and prints

  • The country with the largest area.
  • The country with the largest population.

 •The country with the largest population density (people per square kilometer or mile).

Program 2

Your town has become concerned with the increase in automobile traffic and has invested in purchasing bicycles to rent. Kiosks have been built throughout the town and an inventory of bicycles to rent is available at each kiosk. You have been asked to write a C++ program for your town's kiosk that provides self-service bicycle and scooter rentals:

Your assignment is to develop a Bicycle class with private data members brand, hourlyRentalRate, and rentedBy. Your Bicycle class should implement at least one constructor that sets an initial value for at least one of the data members. Implement accessor member functions for all private data members. Implement a mutator member function that sets the rentedBy data member to a renter when a bicycle is rented.

To test a class you would write a program that uses the constructor to construct an object of the class type and then calls all mutator member functions. Write a program that tests your Bicycle class. You must thoroughly comment your code by providing a comment for each line of code. Apply troubleshooting and testing strategies to ensure your code compiles, runs, and provides accurate results.

Solution Preview :

Prepared by a verified Expert
Business Economics: Define a class country that stores the name of the country
Reference No:- TGS02183260

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)