Hey there, I just started my first program in years and i have a problem. Basically I started writing a construction estimation app.
i enter 1 for ht and len but it keeps showing both as "229332".
Here is the code:
#include<stdio.h>
int no_brick = 0, no_block, no_hours, bl_price = 15, br_price = 400, day_w = 20, b_chce = 0, mm_sqr, m_chce;
int main()
{
printf("Hi, I am going to guide you through estimating the work you want carried out. \n\n");
printf("Just so you know this will only estimate labour costs and the amount of \nmaterials needed.\n\nIf you decide to go ahead with your build we will discuss materials wanted and \ngive you a complete price before going ahead with construction.\n\n");
printf("Now , what is it you want to built \n\nPlease enter a number for the correct choice as follows:\n 1 Garden or retaining wall \n 2 Extension \n 3 House \n 4 Remedial work \n\n :");
scanf("%i", &b_chce);
system("cls");
int len;
int ht;
int mtr_sqr;
switch(b_chce)
{
case 1 :
printf("Lets price your wall!\n\nYou will need the following things: \nMeasuring tape\nPen and paper\n\n");
printf("Now, just measure the length the wall will be by measuring the permimeter you \nwant it so be on.\n\nNow we need the height that you want it to be, the height must be in a multiple of 75mm to work in accordance with brickwork.\n\n");
printf("Now could you enter the length in metre please :");
scanf("%i", &len);
printf("\n\nAnd now enter the height also in metres please:");
scanf("%i", &ht);
printf("\nDo you want the wall built of stone or facing brick?:");
scanf("%i", &m_chce);
printf("no of brick = %i", &ht);
printf("no of brick = %i", &len);
mtr_sqr = len * ht;
printf("no of brick = %i", &mtr_sqr);
no_brick = mtr_sqr * 59;
printf("no of brick = %i", &no_brick);
break;
case 2:
printf("Lets price your extension!");
break;
case 3:
printf("Lets price your house!");
break;
case 4:
printf("Lets try get you a price!");
break;
default:
printf("Please enter the correct choice, thanks.");
}
getch();
return 0;
}