Question: Apparently I am missing the PrintLine function and am confused. Here is my code that works it just is missing the function for PrintLine so
Apparently I am missing the PrintLine function and am confused. Here is my code that works it just is missing the function for PrintLine so please modify it to have it. C Programming!
#include
//function prototypes void PrintLine(int length, char theChar); void PrintRectangle(int width, int height, char theChar); void PrintTriangle(int baseLength, char theChar); void PrintInvertedTriangle(int height, char theChar);
int main(void)
{
char choice; int a, b; char character;
//asking for user input printf("Which shape (L-line, T-triangle, R-rectangle, I-inverted triangle): "); scanf(" %c", &choice); printf("Which character: "); scanf(" %c", &character); switch (choice) { //if user input is for a triangle case 'T': case 't': printf("Enter an integer base length between 3 and 25: "); scanf("%d", &a); if (a >= 3 && a
//if user input is for a rectangle case 'R': case 'r': printf("Enter an integer width and height between 2 and 25: "); scanf("%d%d",&a, &b); if((a25 )){ printf("Width not in range."); break; } if((b25)){ printf("Height not in range."); break; } if(a >= 2&&a=2&&b
//if user input is a line case 'L': case 'l': printf("Enter an integer length between 1 and 25: "); scanf("%d", &a); if (a >= 1 && a
//if user input is an inverted triangle case 'i': case 'I': printf("Enter an integer base length between 2 and 25: "); scanf("%d", &a); if (a >= 2 && a
//if user input isn't a line, rectagnle, triangle or inverted triangle default: printf("Unknown shape. "); break; } }
//line function void PrintLine(int length, char theChar) { int i; for (i = 0; i
//triangle function void PrintTriangle(int baseLength, char theChar) { int i, j; for (i = 1; i
//rectangle function void PrintRectangle(int width, int height, char theChar) { int i, j; for (i = 0; i
//inverted triangle function void PrintInvertedTriangle(int height, char theChar) { int i; for (i = height; i > 0; i--) { PrintLine(i, theChar); } }
Here is what needs to be added
DESCRIPTION Checking for use of printLine function. DEBUG INFO Your instructor has chosen to give you the following information to help you debug your code and improve your submission. COMPILER STACK TRACE MISSING calls to PrintLine PROGRAM EXECUTION STACK TRACE None YOUR CODE'S OUTPUT 1 false 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
