Assignment 05
The Fibonacci series:
0,1,1,2,3,5,8,13,21,....
begins with 0 and 1 and has the property that each subsequent Fibonacci number
is the sum of the previous two Fibonacci numbers. Write:
Information: The series occurs in nature, few examples are the following:
The circle class
In a graphics program, very often there is a need to represent geometric objects, for example: square, ellipsis, triangle, etc. There is a need not only to position them accurately on the screen, not only to draw them and move them around the screen, but we also need to know and display their characteristics / attributes. For this programming assignment you will implement the circle class, where the attributes (data members) should be the following:
x_coord (int): the x-coordinate of the circle
y_coord(int): the y-coordinate of the circle
radius (int): the radius of the circle
area (float): the area of the circle
perimeter (float): the perimeter of the circle
The user should enter the x_coord, y_coord and radius attributes initially (from stdin). The member functions for the circle class should be the following:
circle: constructor
set_coordinates: set the x and y-coordinates of the circle
set_radius: set the radius of the circle
compute_area: compute the area of the circle
compute_perim: compute the perimeter of the circle
display: displays all the attributes of the circle
get_x: return the x-coordinate of the circle
get_y: return the y-coordinate for the circle
get_area: return the area of the circle
get_perim: return the perimeter of the circle
In order to check your circle class, write a circle_driver.cpp program, where you call all the member functions listed above in the same order.
*** In your program, please use the names that i suggested above for both (data members and member functions), name your . cpp file as circle_driver.cpp and create an object of type circle, with a name the_circle.