Hi, I need help changing this code to reference the variables rather than using the return statement. This is as far as I have gotten and my brain is mush...Please help. Thanks!
#include <iostream.h>
#include <conio.h>
void main()
{
int numDrawers;
int x=0;
double total;
//int getDrawers();
//int getWood();
double getTotal(int &numDrawers,int &x);
void PrintPrice(double &total);
numDrawers = getDrawers();
x = getWood();
total = getTotal(numDrawers,x);
PrintPrice(total);
}
int getDrawers()
{
int numDrawers;
cout <<"Enter the number of drawers you would like."<<endl;
cin >> numDrawers;
//return numDrawers*30;
}
int getWood()
{
char x;
int i=0;
int j=0;
char woods[3] = {'M', 'O', 'P'};
int cost[3] = { 180, 140, 100};
cout<<"Please choose the wood you would like for your desk;"<<endl;
cout<<"M for Mahogany, O for Oak, P for Pine."<<endl;
cin >> x;
for (i=0; i<=3; i++)
{ if (x==woods)
j=i;
}
//return cost[j];
}
double getTotal(int &numDrawers, int &x)
{
double c=0;
c=numDrawers + x;
//return c;
}
void PrintPrice(double &total)
{
cout << "The price of this desk is $"<<total<<endl;
}