Menu

[Solved]Lab Problem Done Earlier Use Pointers Prototype Readchar Function Like Void Readchar Char Q37208719

in C++
In this lab, you will do the same problem that was done earlier but now you have to use pointers Prototype for readChar() funThat is, parameters will all be passed by reference. You should still have the same output as before, hence a sample run is aIn this lab, you will do the same problem that was done earlier but now you have to use pointers Prototype for readChar() function will be like this: void readChar(char); That is, function will be void now and value of type char will be returned from function via a reference This function will prompt with “Enter character to useand then return the character via reference (using pointers). It will get the character in example below Prototype for getNum) function will be like this: void getNum(string,int *); This function will be called with the string to be displayed such as “How many rows” and also a pointer for the int value that will be entered and returned via reference. The function will be called to get the number of rows and again for the number of columns. This is the call for the rows variable. getNum (“How many rows?,&rows) Note the pass by reference of the variable rows Similarly, to get the value for the columns into the variable cols, we will call the same getNum() function but now with a different string. So, it will be: getNum (“How many columns?, &cols) Prototype for printBox() function will be like this: void printBox(int rowPtr,int colPtr, char *chPtr); That is, parameters will all be passed by reference. You should still have the same output as before, hence a sample run is as follows Enter character to use How many rows? How many columns? aeea geee geee a@@a Show transcribed image text In this lab, you will do the same problem that was done earlier but now you have to use pointers Prototype for readChar() function will be like this: void readChar(char); That is, function will be void now and value of type char will be returned from function via a reference This function will prompt with “Enter character to useand then return the character via reference (using pointers). It will get the character in example below Prototype for getNum) function will be like this: void getNum(string,int *); This function will be called with the string to be displayed such as “How many rows” and also a pointer for the int value that will be entered and returned via reference. The function will be called to get the number of rows and again for the number of columns. This is the call for the rows variable. getNum (“How many rows?,&rows) Note the pass by reference of the variable rows Similarly, to get the value for the columns into the variable cols, we will call the same getNum() function but now with a different string. So, it will be: getNum (“How many columns?, &cols) Prototype for printBox() function will be like this: void printBox(int rowPtr,int colPtr, char *chPtr);
That is, parameters will all be passed by reference. You should still have the same output as before, hence a sample run is as follows Enter character to use How many rows? How many columns? aeea geee geee a@@a

Expert Answer


Answer to In this lab, you will do the same problem that was done earlier but now you have to use pointers Prototype for readChar(… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *