Question: I need help completing this program. I keep receiving errors and have not been able to figure out why. I provided screenshots of what the
I need help completing this program. I keep receiving errors and have not been able to figure out why. I provided screenshots of what the program should like below. Please help, Thank You in advance!
#include// Function Prototypes========================================================= // Do NOT change the signature of these function prototypes. // If you do, your code will not compile with my altered main() function // I suggest that you copy the prototypes below and then fill them in. // ---------------------------------------------------------------------------- // Read in a line of text INCLUDING SPACES into a string. // You may assume that the input will NOT exceed the maxLength available. // Keep in mind that cin stops reading at a whitespace. See page 318. void ReadString(char * c, int maxLength); // Get the length of the string and store it in length // Hint: How does C++ terminate a string? Look for that character! void GetStringLength(char * c, int * length); // PrintString - Just print the string in forward order using cout void PrintString(char * const c); // PrintStringBackwards - Print the string in reverse order using cout void PrintStringBackwards(char * const c); // Search the string for the test character. Return -1 if not found int FindIndexOfCharacter(char * c, char testVal); // Return a pointer to the character at the index given char * GetValueAtIndex(char * const c, int index); // Return the ascii integer value of the character at requested index int GetIntegerValueOfIndex(char * c, int index); // Print the hexadecimal value of the character at the requested index void PrintHexValueAtIndex(char * c, int index); // Make the entire string uppercase void MakeUpperCase(char * c); // Make the entire string lowercase void MakeLowerCase(char * c); // ============================================================================ // DO NOT REMOVE THESE COMMENTS -- comments that start with @ are actually // commands to the assessment tool. //@include(main) //@addRule(commentAll) int main() { // Use these variables to test. // SIZE could change so make sure your code works with different sizes. const int SIZE = 80; char ca[SIZE]; char * pc = ca; int fPrints = 0; int bPrints = 0; int lengthChecks = 0; // Your code below // ========================= // ========================= // Your code above std::cout
Part of the output should look like this.
[1] Test ReadString [ 2] Test GetStringLength [ 3] Test PrintString [ 4] Test PrintStringBackwards [ 5] Test FindIndexOfCharacter 6] Test GetValueAtIndex 7] Test MakeUpperCase [ 8] Test MakeLowerCase [ 9] Test GetIntegerValueOfIndex [10] Test PrintHexValueAtIndex [99] Quit Selection: 1 Enter a string less than 80 character: 30 [ 1] Test ReadString 2] Test GetStringLength I 3] Test PrintString [ 4] Test PrintStringBackwards [ 5] Test FindIndexOfCharacter 6] Test GetValueAtIndex I 71 Test MakeUpperCase [ 8] Test MakeLowerCase [ 9] Test GetIntegerValueOfIndex [10] Test PrintHexValueAtIndex [99] Quit Selection: 2 Length [1]=2 I 1] Test Readstring [ 2] Test GetStringLength [ 3] Test PrintString [4] Test PrintStringBackwards [ 5] Test FindIndexOfCharacter [ 6] Test GetValueAtIndex I 71 Test MakeUpperCase [ 8] Test MakeLowerCase [ 9] Test GetIntegerValueOfIndex [10] Test PrintHexValueAtIndex [99] Quit Selection: 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts




