Adjusting to a new level

Pages: 123
ok... OP = what? and i realize that the answer is in the question

"Create a structure named Carpet that has two public data members: lengthInFeet and widthInFeet.
Write a main() function that instantiates a Carpet object and assigns values to its fileds.
Pass the object to a function named Area() that calculates the carpet area in square feet and displays the results.
Save the file as Carpet.cpp"

ok i under stand the creating of the two members L.I.F; and W.I.F;
i also understand the main () function but other then a little minor editing that is needed to some parts in my code here and there would my code be useable if i did some minor editing
No MSkillet, the task clearly said that the OP( as in, O.riginal P.oster) needs to use "struct with two public data members" and "function Area()" to solve the task. The output of your program would of course be the same, but it's NOT what the OP asked for.

If you don't know what that's supposed to mean, the tutorials bazzy linked to:

http://www.cplusplus.com/doc/tutorial/functions/
http://www.cplusplus.com/doc/tutorial/structures/
http://www.cplusplus.com/doc/tutorial/classes/


might help you understand why your solution isn't incorrect, but in this case not relevant to the task.
Last edited on
closed account (jwC5fSEw)
MSkillet, it's usually a good idea to actually read the OP before you answer it. Your program is simpler, but it's not at all what the OP was asking for.
ok then i defently will look into those forums and i understand that the op asked for something else but now i know what it really was
Topic archived. No new replies allowed.
Pages: 123