Hi. I can't figure out what I'm doing wrong here. I know I have to instantiate a Carpet object, assign values then pass the instance to the printArea func. Easier said than done! Thanks for any help!! L
#include<iostream.h>
#include<conio.h>
class Carpet
{
public:
int lengthInFeet;
int widthInFeet;
};
void main()
{
int lengthInFeet=12;
int widthInFeet=12;
int total;
total=lengthInFeet*widthInFeet;
getch();
}
void printArea(total)
{
cout<<"The area of carpet is "total"sq. feet."<<endl;
}