#include<iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
// This is a skeleton hw13.h file. You must complete it.
// You are not allowed to modify the parts of the class
// definitions provided for you with the exception that you
// have to provide public member functions to allow the
// access that you need.
const int maxFinHeight = 100;
const int maxFinWidth = 100;
class Steampipe
{
private:
int height,width;
double steamTemp;
public:
Steampipe (int H = 0, int W = 0, double sT = 0.0)
{
height = H;
width = W;
steamTemp = sT;
}
int getheight()const{return height;}
int getwidth()const{return width;}
double getsteamTemp()const{return steamTemp;}
void setheight(int h = 0){height = h;}
void setwidth(int w = 0){width = w;}
void setsteamtemp(double temp = 0){steamTemp = temp;}
// Access function definitions
};
class GridPt
{
private:
double temperature;
char symbol;
public:
GridPt(double t = 0.0, char s = '?')
{
temperature = t;
symbol = s;
}
double gettemperature()const{return temperature;}
char getsymbol()const{return symbol;}
void setTemperature(double temp = 0){temperature = temp;}
void setSymbol(char symb = '?'){symbol = symb;}
// Access function definitions
};
class Fin
{ //line 61
private:
int width, height; //width and height of fin
int pipeLocationX, pipeLocationY; //grid location of lower left corner of steampipe
double boundaryTemp; //temperature of fin surroundings
Steampipe Pipe; //steampipe object - COMPOSITION
GridPt GridArray[maxFinHeight][maxFinWidth]; // array of GridPts - COMPOSITION
public:
double getboundaryTemp() const {return boundaryTemp;}
int getwidth()const{return width;}
int getheight()const{return height;}
int getpipeX()const{return pipeLocationX;}
int getpipeY()const{return pipeLocationY;}
void initialize(const Fin& F); // YOU MUST DEFINE
void setFwidth(int w = 0){width = w;}
void setFheight(int h = 0){height = h;}
void setPx(int x = 0){pipeLocationX = x;}
void setPy(int y = 0){pipeLocationY = y;}
void setFtemp(double temp = 0){boundaryTemp = temp;}
friend istream& operator>>(istream& , Fin&); // YOU MUST DEFINE
friend ostream& operator<<(ostream& , const Fin& ); // YOU MUST DEFINE
};
void Fin::initialize(const Fin& F)
{
//------SETS BOUNDARY OF FIN TEMP AND CHAR-------
for(int i = height - 1, int j = 0; j < width; j++)
{
F.GridArray[i][j].setTemperature(boundaryTemp);
char symb = 'C';
F.GridArray[i][j].setSymbol(symb);
}
for(int i = 0, int j = 0; j < width; j++)
{
F.GridArray[i][j].setTemperature(boundaryTemp);
char symb = 'C';
F.GridArray[i][j].setSymbol(symb);
}
for(int j = 0, int i = 0; i < height; i++)
{
F.GridArray[i][j].setTemperature(boundaryTemp);
char symb = 'C';
F.GridArray[i][j].setSymbol(symb);
}
for(int j = width - 1, int i = 0; i < height; i++)
{
F.GridArray[i][j].setTemperature(boundaryTemp);
char symb = 'C';
F.GridArray[i][j].setSymbol(symb);
}
//-------------------------------------------------
//------SETS PIPE TEMP AND CHAR--------------------
for(int i = height - 1 - pipeLocationY; i > height - 1 - pipeLocationY - F.Pipe.height; i--)
{
for(int j = pipeLocationX; j < F.Pipe.width + pipeLocationX; j++)
{
F.GridArray[i][j].setTemperature(F.Pipe.steamTemp);
char symb = 'H';
F.GridArray[i][j].setSymbol(symb);
}
}
}
Here are the errors it is giving me
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(93): error C2062: type 'int' unexpected
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(93): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(93): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(93): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(93): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(94): error C2143: syntax error : missing ';' before '{'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(95): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(95): error C2228: left of '.setTemperature' must have class/struct/union
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(97): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(97): error C2228: left of '.setSymbol' must have class/struct/union
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(99): error C2062: type 'int' unexpected
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(99): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(99): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(99): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(99): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(100): error C2143: syntax error : missing ';' before '{'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(101): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(101): error C2228: left of '.setTemperature' must have class/struct/union
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(103): error C2065: 'j' : undeclared identifier
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(103): error C2228: left of '.setSymbol' must have class/struct/union
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(105): error C2062: type 'int' unexpected
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(105): warning C4552: '<' : operator has no effect; expected operator with side-effect
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(105): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(105): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(106): error C2143: syntax error : missing ';' before '{'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(107): error C2662: 'GridPt::setTemperature' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(109): error C2662: 'GridPt::setSymbol' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(111): error C2062: type 'int' unexpected
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(111): warning C4552: '<' : operator has no effect; expected operator with side-effect
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(111): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(111): error C2143: syntax error : missing ';' before ')'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(112): error C2143: syntax error : missing ';' before '{'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(113): error C2662: 'GridPt::setTemperature' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(115): error C2662: 'GridPt::setSymbol' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(120): error C2248: 'Steampipe::height' : cannot access private member declared in class 'Steampipe'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(19) : see declaration of 'Steampipe::height'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(17) : see declaration of 'Steampipe'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(122): error C2248: 'Steampipe::width' : cannot access private member declared in class 'Steampipe'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(19) : see declaration of 'Steampipe::width'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(17) : see declaration of 'Steampipe'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(124): error C2248: 'Steampipe::steamTemp' : cannot access private member declared in class 'Steampipe'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(20) : see declaration of 'Steampipe::steamTemp'
1> c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(17) : see declaration of 'Steampipe'
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(124): error C2662: 'GridPt::setTemperature' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers
1>c:\users\zach\documents\visual studio 2010\projects\hw13\hw13\hw13.h(126): error C2662: 'GridPt::setSymbol' : cannot convert 'this' pointer from 'const GridPt' to 'GridPt &'
1> Conversion loses qualifiers

New Topic/Question
Reply




MultiQuote





|