stuck on function declaration problem

I'm having trouble the function declaration. Would I keep void or just use double?

/*
Program: repair2b: this program prompts for the dimensions of a box (width,len,ht)
then displays the volume and surface area
Example:
If width is 5, len is 6, and ht is 10,
volume is 300.000, surface area is 280.000
If width is 4.8, len is 5.5 and ht is 6.5
volume is 171.600, surface area is 186.700
Add the missing first line of the function and add the function declaration
DO NOT make any other changes
DO NOT us unnecessary refernce parameters
*/

#include <iostream>
#include <iomanip>
using namespace std;

void Displayvolume(double le, double width, double ht, double volume, double surfacearea);

void Displaysurfacearea(double length, double width, double ht, double volume);//Function Declaration goes here


int main(void)
{
double width, len, ht, volume, surfacearea;

cout << "Enter width, len, ht: ";
cin >> width >> len >> ht;

box(width, len, ht, volume, surfacearea);

cout << fixed << setprecision(3);
cout << "Volume is " << volume << " surface area is " << surfacearea << endl;

return 0;
}

void Displayvolume(double le, double width, double ht, double volume, double surfacearea);

void Displaysurfacearea(double length, double width, double ht, double volume)//First line of the function goes here
{
vol = width * len * ht;
surfacearea = 2 * width * len + 2 * width * ht + 2 * len * ht;
}
Last edited on
Can you put your code inside

[code]

[ / code]

and output inside:

[output]

[ / output]

It is much easier to follow your code in that way.
Last edited on
Topic archived. No new replies allowed.