class brick
{ private: 
    int  length, width, height;// in mm
    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;

    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;

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

Edited by kumanutiw: error inclusion

1 Year
Discussion Span
Last Post by NathanOliver

please help as this is not a problem of curly brace matching. If i remove the folloing part of code, it works...

double hwalllen=12.0;
    double hwallwid=0.23;
    double hwallhei=3.0;                 // storing wall data
    int q;                                                       //no of b1  bricks required
    q= hwalllen*1000 / b1.getlength()*
    hwallwid*1000 / b1.getwidth()*
    hwallhei*1000 / b1.getheight();
cout<< " the no of type 1 bricks required for one wall:"<<4 * q;

If i remove above part it woeks..please help...
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.