5 points - Due session 2
The purpose of this assignment is to help you gain experience using the C++ compiler to build a simple program. After completing this assignment, you should feel comfortable going through the steps of editing, compiling, linking, and running your program.
Create a C++ class called CWorld that represents the planet Earth. This class exposes two methods (i.e. member functions). The first one, SetPopulation(), takes a single integer as an argument. The integer represents the current number of people on the planet, measured in billions. The second method, Greet(), takes no arguments, and prints the following message to the screen: "Hello to all the xxx billion people of the world!" In the output, xxx must be replaced by the current population of the planet. So if we assume a world population of 6 billion people, the message should read, "Hello to all the 6 billion people of the world!"
Remember, each class requires that you create two files: a header file (.h) that contains the class definition, and an implementation file (.cpp or .C) that contains the code for the methods.
Finally, implement a main() function in a third file. This function must create an object of type CWorld. Then, it must call the object's SetPopulation() method, followed by the Greet() method to print an appropriate message.
Compile, link, and run your program. If you are using Visual C++, also try stepping through the program's execution using the F11 key.
Put all three program files into an archive file named hw1.zip or hw1.tar.Z. Save this archive file in your AISYG 240 course directory (Courses/AISYG 240) on ftp.coe.neu.edu.