1. ## Heeeelp

Hello
I would need help, it says right after here: XXX
that expected expression before else, but cant figure it out. Any hints? Thanks!

Code:
```#include <stdio.h>

main ()

{

double totalsqft, roomsqft,ceilingsqft,length,width;
double labour, ceilingcost, totalcost;
int quality,ceiling;

/*Program*/

printf(">>>   Paint Cost Estimator   <<<\n");
printf("Enter length of the room:");
scanf("%lf",&length);
printf("Enter width of the room in feet:");
scanf("%lf", &width);
scanf("%d",&quality);

if (quality == 1)
{
}
if(quality==1 && ceiling==2);
{
}
else  XXX
{
}

if (quality==2)
{
regularcost=2*8*length+2*8*width*2*30/400;
}
if( quality==2 && ceiling==2);
{
regularcost=2*8*length+2*8*width*2*30/400+width*length*20/400*2;
}
else      XXXXX
{
regularcost=0;
}
if (quality==3)
{
basiccost=2*8*length+2*8*width*2*20/400;
}
if ( quality==3 && ceiling==2);
{
basiccost=2*8*length+2*8*width*2*20/400+width*length*20/400*2;
}
else     XXX
{
basiccost=0;
}

printf("Enter if ceiling to be painted [Yes-1,No-2]:");
scanf("%d", &ceiling);

if (ceiling != 1)
{
ceilingcost = 0;
}
else
{
ceilingcost = width*length*20/400*2;
}

/*Calculate room squarefeet*/

roomsqft=2*8*length+2*8*width;
totalsqft=ceilingsqft+roomsqft;
labour=100+40*totalsqft/200;
ceilingsqft=width*length;

printf("Total Area: %.2lf sqft\n",totalsqft);
printf("Regular paint cost: \$ %.2lf\n", regularcost);
printf("Basic paint cost: \$ %.2lf\n", basiccost);
printf("Labour costs: \$ %.2lf \n", labour);
printf("TOTAL COST: \$ %.2lf \n",totalcost);

}```

2. Code:
```if (quality == 1)
{
}
if(quality==1 && ceiling==2);
{
}
else  // XXX -- I give up, a rabbi?
{
}```
Logic error? So are you intending for this to happen?

3. Code:
```   if ( quality==3 && ceiling==2);
{
basiccost=2*8*length+2*8*width*2*20/400+width*length*20/400*2;
}
else     XXX
{
basiccost=0;
}```
Did you mean to put a semicolon after that if statement? I'm pretty sure what happens is that the compiler thinks you're making a one line if statement, and thus does not associate the else with it.

4. Right on the spot.

Code:
```#include <stdio.h>

main ()
{

double totalsqft, roomsqft,ceilingsqft,length,width;
double labour, ceilingcost, totalcost;
int quality,ceiling;

/*Program*/

printf(">>>   Paint Cost Estimator   <<<\n");
printf("Enter length of the room:");
scanf("%lf",&length);
printf("Enter width of the room in feet:");
scanf("%lf", &width);
scanf("%d",&quality);

if (quality == 1)
{
}
if(quality==1 && ceiling==2);
{
}
else  XXX // Wth???
{
}

if (quality==2)
{
regularcost=2*8*length+2*8*width*2*30/400;
}
if( quality==2 && ceiling==2);    {
regularcost=2*8*length+2*8*width*2*30/400+width*length*20/400*2;
}
else      XXXXX // Wth???
{
regularcost=0;
}
if (quality==3)
{
basiccost=2*8*length+2*8*width*2*20/400;
}
if ( quality==3 && ceiling==2);
{
basiccost=2*8*length+2*8*width*2*20/400+width*length*20/400*2;
}
else     XXX // Wth???
{
basiccost=0;
}

printf("Enter if ceiling to be painted [Yes-1,No-2]:");
scanf("%d", &ceiling);

if (ceiling != 1)
{
ceilingcost = 0;
}
else
{
ceilingcost = width*length*20/400*2;
}

/*Calculate room squarefeet*/

roomsqft=2*8*length+2*8*width;
totalsqft=ceilingsqft+roomsqft;
labour=100+40*totalsqft/200;
ceilingsqft=width*length;

printf("Total Area: %.2lf sqft\n",totalsqft);
printf("Regular paint cost: \$ %.2lf\n", regularcost);
printf("Basic paint cost: \$ %.2lf\n", basiccost);
printf("Labour costs: \$ %.2lf \n", labour);
printf("TOTAL COST: \$ %.2lf \n",totalcost);

}```
Errors in red.
Furthermore, two more errors:

warning C4700: uninitialized local variable 'ceiling' used (line 25)
warning C4700: uninitialized local variable 'ceilingsqft' used (line 75)

5. Besides what I had bolded and was reaffirmed by the masses, look at the actual if statements too. I mean read them and think about what you are saying?

Are you doing something more than once? Would more work being done redundantly mean that your computer is wasting its time?