After completing the all the parts, paste the snapshot and code the output in one file.
Question: In-class programming Practice
Requirement: create one project for each problem; add comments to your code.
Question1: Using the class Rectangle you wrote, write a program which
1. Add a static data member to count the number of objects will be created.
2. Dynamically create 10 Rectangle objects.
3. Get the sum of all these objects'areas.
4. Print out how many objects were created.
Question 2 Re-organize the code of program 2 using headfile (.h), implement file and executable code.
Question 3 Given an class Point, modify the class Rectangle:
1) add a private data member: Point center (the center of the Rectangle)
2) add a public member function: move (int x, int y), which can move the center of the Rectangle to the position (x,y).
3) Write a test program
How to add a static data member and prepare a test program? Support your rationale.