Your program should contain 4 pieces of data, all integers - the number of rows
ID: 3614004 • Letter: Y
Question
Your program should contain 4 pieces of data, all integers - the number of rows in the grid, the number of columns, the number of spaces in each box horizontally, and the number of lines in each box vertically. Feel free to hardcode all this into the main program. I want you to do this problem in a functional style, which means I want your program to contain: a function that prints out one horizontal beam +---. This function should take a single argument (the number of horizontal spaces in each box). a function that calls the previous one to print out the whole horizontal line +---+---+. This function needs 2 arguments. Two functions that do the same thing for the open lines | | | A function that prints a whole row: And finally a function to print the whole grid. Use your program to print out a grid with 2 columns, 3 rows, 4 spaces horizontally in each box and 5 vertically.Explanation / Answer
please rate - thanks #include #include void beam(int); void columns(int,int); void spaces(int); void lines(int,int); void box(int,int,int,int); int main() {int row,col,space,line; printf("Enter the number of rows: "); scanf("%d",&row); printf("Enter the number of columns: "); scanf("%d",&col); printf("Enter the number of spaces: "); scanf("%d",&space); printf("Enter the number of lines: "); scanf("%d",&line); box(row,col,space,line); getch(); } void beam(int n) {int i; printf("+"); for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.