I wrote this program but im actually suppose to write it as a function..But im having a lot of trouble writing it as a function... Can someone please explain how i would do that...Thx
Calculation functions:
o Write a function to calculate the total cubic feet (Length x Width x Depth) and
return the cubic feet.
Inputs: Length, Width, and Depth
Return cubic feet
o Write a function to calculate the number of gallons:
1 cubic foot = 7.48051948 US gallons (Create a constant to hold the conversion factor.) Input: Cubic Feet Return Gallons
#include <iostream>
#include <cmath>
using namespace std;
I guess this is like I am the bad cop and hamsterman is the good cop :D I assume you are guilty (i.e. you haven't read anything about your task subject, which is functions) and I direct you to the tutorial, while hamsterman hands you the core for the definitions of your functions and waits for you to ask for more help, thus proving yourself guilty :P
Relax, fellas. Seeing as your posts were separated by two minutes, it's possible that hamsterman didn't see your post.
First of all, you can't be guilty of ignorance. ...okay, yes you can. However, he may have a teacher that is outright boring. ...okay, that's no excuse. But he may have a very poor teacher. ...shutting up now.
Second, hamsterman, c'mon. You pretty much gave him the solution to his problem, something that you should know that we here frown upon. His problem was that he didn't know how to define the functions, not calculate the volume.
Third, I recommend [code] tags.
Fourth, it looks like everything is in order here, otherwise. Nice work.
-Albatross
P.S.
300-- posts and counting.
ERROR: Lvalue required as decrement operand.
By the way just because im having problems with functions does not mean i havent read anything on the subject... This is beginners forum and thats why I came here for help... I am on an online class where the professor tends to ignore all emails.... So i come here to try and get help.