Question
write a c++ program that prompts the user for the radius of a circle and calculates and displays the area. - create a class, Circle
write a c++ program that prompts the user for the radius of a circle and calculates and displays the area.
- create a class, Circle : has a private data member 'radius' of type double
- in main()
1. instantiate an object of class Circle
2. prompt the user to enter the radius of a circle, store this value in the instantiated object -- how?
3. call a global function that calculates and returns the area of a circle using the Circle object as the argument for the function call
4. display the radius and the area of the circle
This shouldn't be complicated
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started