☑Kizspy.me
Question 6:
(2 mark, file to be edited: Q6.cpp)
Write a program to manage books using object-oriented programming.
Requirements:
1. Define a Circle class (placed in the same file containing the main() function) with:
o Two attributes: id (int), radius (float).
o A constructor to initialize all attributes.
o A method area() to calculate the area.
o A method perimeter() to calculate the perimeter.
2. In the main() function:
o Read circle's information from the keyboard.
o Create a circle object and show it's its area and perimeter.
Below is an example:
Enter id=1; radius=2.5
Zoom
- FUO
+ 100%
Close