Question: c program (visual studio preferred) Description This assignment is to write a program that will prompt the user to enter a character, e.g, a percent

 c program (visual studio preferred) Description This assignment is to write c program (visual studio preferred)
a program that will prompt the user to enter a character, e.g,
a percent sign (%), and then the number of that character they

Description This assignment is to write a program that will prompt the user to enter a character, e.g, a percent sign (%), and then the number of that character they want on a line. Your program should first read a character from the keyboard, excluding whitespaces, and then print a message indicating that the number must be in the range 1 to 79 (both inclusive) if the user enters a number outside of that range. Your program should continue this behavior until you have received an appropriate integer. Use a loop to trap the user until you get the value that you want as you did in a previous assignment. You should also clear the keyboard buffer after each scanf so that the user can type characters or digits in their response. Once you have a number in the appropriate range, call a function that you write called drawline that takes two arguments. One argument is the number of characters and the other argument is the character to draw. The function will use a for loop to draw that number of characters on the screen and then will print a newline. > run Please enter the character you want to draw: Please enter the number of characters you want in your line: -8 I'm sorry, that number is unrecoginized or out of range, try [1-79): why? I'm sorry, that number is unrecoginized or out of range, try (1-79): draw them! I'm sorry, that number is unrecoginized or out of range, try (1-79): ok, fine I'm sorry, that number is unrecoginized or out of range, try [1-79): ######## Edit View Tools Project Build 2. Debug Debug Test Analyze x 86 Extensions Local Windows Debugger Search (Ctrl+0) . daily menu (Global Scope) main(int args, const char * argv[] nclude Evoid clearKeyboardBuffer(void) { char ch; sconfo &ch); while (ch != ' ' && ch ! -' ') { scanf("%c", &ch); }} void drawLine(int n, char ch){ int i; for (i - @;i79){ clearkeyboardBuffer(); printf("I'm sorry, that number is unrecoginized or out of range, try (1-791 ); ASA drawLine(n, ch); return ; En: 21 Ch: 25 e Solution Code 3 Errors ! 4 Warnings O Messages * Description 'drawLine's recursive on all control paths, function will cause runtime stack overflow unsolved rxternal symhol main referenced in function int u l Build - IntelliSense Project daily 10 Search Error List Line Suppression : File daily 10.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!