Name: Master Yi 2012-11-05 11:35
I am here to assess your skills as a community:
Instructions
1. Create a Hexagonclass with:
a. Two member variables, one used to hold the size of the hexagon, one to hold its
type
b. Appropriate getters/setters for the member variables
c. A suitable constructor
2. Write a program that:
a. Asks the user to enter the size of the hexagon, as well as its type
b. Creates an instance of the Hexagonclass, and sets its size and type to that input by
the user
3. Add a displaymethod to the Hexagonclass
a. This should print hexagon shapes like those shown above, using the size and type
contained in the object’s member variables
b. Adjust the above program so that it allows the hexagon to be printed using the
display method
4. Add an option to your program to repeat the drawing with a hexagon of a different size and
type, until the user chooses to exit.
Language - C++
Instructions
1. Create a Hexagonclass with:
a. Two member variables, one used to hold the size of the hexagon, one to hold its
type
b. Appropriate getters/setters for the member variables
c. A suitable constructor
2. Write a program that:
a. Asks the user to enter the size of the hexagon, as well as its type
b. Creates an instance of the Hexagonclass, and sets its size and type to that input by
the user
3. Add a displaymethod to the Hexagonclass
a. This should print hexagon shapes like those shown above, using the size and type
contained in the object’s member variables
b. Adjust the above program so that it allows the hexagon to be printed using the
display method
4. Add an option to your program to repeat the drawing with a hexagon of a different size and
type, until the user chooses to exit.
Language - C++