Class Sample?

Not quite sure how to do this...

Implement a class SodaCan with functions get_surface_area() and get_volume(). In the constructor, supply the height and radius of the can. Download lab5a.cpp. This skeleton program only contains a driver of class SodaCan, but the class interface and implementation are missing. Your job is to complete this program.

Formulas ( pi=3.1415926, R is radius, H is height):
can surface area = 2piRH +2piR2
can volume = piR2H

Your complete program should display the following results (or approximate values):

#include <iostream>

using namespace std;

   A cylindrical can.

//define interface here:
class SodaCan


//implemente the class Can here:

// a driver:
int main()
   SodaCan can(10, 5); //height is 10, and radius is 5
   cout << can.get_volume() << "\n";
   cout << can.get_surface_area() << "\n";
   return 0;
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This appears to be an academic assignment.   The instructions are clear.  The skeletal program provides most of the infrastructure, leaving your task to implement the specified class methods.  The experts here cannot do your homework for you - neither of us would learn anything.  If you are having some difficulty doing the assignment, you may ask for some assistance.  But you cannot simply post the assignment here and expect someone to do all the work for you.
You have the basic idea in your disposal. Just implement the function.
And if you face any difficuly after implementation then post you questions.
//define interface here:
class SodaCan
   float get_surface_area();
   float get_volume();

   int height;
   int radius;

just implement those 2 functions

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.