class brick
{ private:
int length, width, height;// in mm
public:
void set(int len, int wid, int hei);
int getlength(){return length;}
int getwidth(){return width;}
int getheight(){return height;}
};
void brick::set(int len, int wid, int hei)
{ length=len;width=wid;height=hei;}
#include <iostream>
using namespace std;
/*After Set() method write main() function which would have one object of type Brick. Display
the data of the object. Write sentences for displaying output on the screen in the beginning of program file:*/
int main()
{
brick b1;
b1.set(250,120,88);
cout<<"brick height is:"<<b1.getheight()<<endl;
cout<<"brick length is:"<<b1.getlength()<<endl;
cout<<"brick width is:"<<b1.getwidth()<<endl;
/*Extend the program with variables to store house wall height, length and width in meters:also Extend the program to
calculate required number bricks of type 1 for house walls:*/
double hwalllen=12.0,hwallwid=0.23,hwallhei=3.0; // storing wall data
int b1n; //no of b1 bricks required
b1n= (hwalllen*100/b1.getlength())*(hwalllen*100/b1.getlength())*(hwalllen*100/b1.getlength());
cout<< " the no of type 1 bricks required for one wall:"<< b1n;
return(0);
}
This error is coming while running:
Error 1 error C1075: end of file found before the left brace '{' at 'c:\users\kumar anubhav\documents\labclass1\brick.cpp(19)' was matched c:\users\kumar anubhav\documents\labclass1\brick.cpp 20 1 labclass1
But if I remove 34 to 37 lines, it wshows no error and runs properly...please help