New to working with C++, just trying to do a cube calculation using 3 functions. However, when I call my calculation function in main, I get an error saying "Error: expected a ')'"
Not sure what's up.
//Programmer: Kevin Shick
//Date: 03/05/2015
//Lab #1 - Cube Functions
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int getCubeSide();
void calcCube(int cubeSide);
void display(int cube);
int main()
{
getCubeSide();
calcCube(int cubeSide);
display;
system("pause");
}
int getCubeSide()
{
int cubeSide = 0;
cout << "Please enter an integer to calculate the size of your cube: " << endl;
cin >> cubeSide;
return cubeSide;
}
void calcCube(int cubeSide)
{
int cube = (cubeSide * cubeSide * cubeSide);
}
void display(int cube)
{
cout << "The area of your cube is: " << cube << endl;
}
Aucun commentaire:
Enregistrer un commentaire