View Single Post
Old 06-05-2005, 04:40 PM   #1 (permalink)
rogue
Registered User
 
Join Date: Apr 2005
Posts: 9
rogue is on a distinguished road
Smile redhead another question

I am trying to make a chart showing lumber sizes and such.

The chart needs to show

Quote:
Lumber Cross-Sectional Moment of Section
Size Area Inertia Modulus

2 x 2 4 1.3 1.3
2 x 4 8 10.7 5.3
2 x 6
2 x 8
2 x 10
2 x 12
4 x 2
4 x 4
(and so up to 10x12)
I am doing something wrong beucase its not allowing me to enter but the base and then the program freezes.This is my code I was trying to put in a certain amount of spaced befor eit showed the chart.

Quote:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>




float lumber;
char base[10];
char height[12];
int moment;
int sectionmod;
int y=12;
int z=10;
char lumbersize;
float crosssection;
char userresponse;

int main()
{
printf("please enter base");
scanf("userresponse");


while (userresponse<=10);
{
base[z]=userresponse;

printf("please enter height");
scanf("userresponse");
}
while (userresponse<=12)
{
height[y]=userresponse;
crosssection=base[z]*height[y];
moment=crosssection/12;
sectionmod=crosssection/6;

printf("\n\tLumber size%7dCross-sectional area %8dMomentof inertia%9dSection modulous");
printf("\n\t%2c%1d %9c %10c%14c,&base,&height,&crosssection,&moment,&sect ionmod");
}
}
Thank you for any help you can give me.
~Valerie
rogue is offline   Reply With Quote