Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions