OK here is my problem
At the end, instead of having cont= 'a' and closing the problem... I want to ask the user if they have another room. And if they enter Y or y to ask them for the room width and room length of that room.Code:int main(void) { int tiles; /* tile size in inches */ printf("Enter the size of the tiles in inches > "); scanf("%d", &tiles); char cont = 'Y'; while (cont == 'Y' || cont == 'y') { int wid_inch; int wid_feet; int length_inch; int length_feet; int total_tiles; char sent; double length_total; double width_total; double length_tile; double room_tile; printf("Enter the room width (feet and inches seperated by a space): "); scanf("%d %d", &wid_feet, &wid_inch); printf("Enter the room length (feet and inches separated by a space): "); scanf("%d %d", &length_feet, &length_inch); width_total = (wid_feet * 12) + wid_inch; room_tile = ceil(width_total / tiles); length_total = (length_feet * 12) + length_inch; length_tile = ceil(length_total / tiles); total_tiles = room_tile * length_tile; printf("The %d'%d width and %d' %d length room requires %d, %d inch tiles\n\n", wid_feet, wid_inch, length_feet, length_inch, total_tiles, tiles); cont = 'a'; } return(0); }
Then eventually I also want to add all tiles together.



LinkBack URL
About LinkBacks


