I'm a rookie when it comes to C but I'm learning. I was wondering if someone can give me advice on my code? I'm trying to write a function that receives from the calling program the length and width of a room in decimal feet. The function should then caculate and return the number of square yards in the room.
I would like my main program to prompt for the dimensions of the room in decimal feet and the cost of a yard of carpet. Then, I would like to display both the number of yards needed and the total cost of the carpet.
I think I have my code in my function mixed up with the code in my main program. I didn't totally finish because I'm at this roadblock. Please, this is probably basic to some, but I'm just starting out. Thanks in advance for any advice. Here is my code:
double room(double length, width, yds)
double length, width, cost, total;
cout<<"Enter the width of the room:";
cout<<"Enter the length of the room:";
cout<<"Enter the cost of a yard of carpet:";