Question: Practice 02: Working with array of character (10 marks) 1. Study the program 6.2 (in appendix) to understand the task performed and how arrays of


Practice 02: Working with array of character (10 marks) 1. Study the program 6.2 (in appendix) to understand the task performed and how arrays of characters are created. Then, copy, compile and run the program of Program 6.2. Type computer. when ask for input. The program will produce the following output (Figure 6.3). Enter up to 10 characters. (Enter to stop the input): computer - Display in reverse order retupmoc Press any key to continue ... Figure 6.3: Output program 6.2 3 2. Now, without changing the original code of the program, add a user-defined function 2. Now, without changing the original code of the program, add a user-defined function named originalOrder. The function receives the elements of array. Then, it writes the letters back to the screen in its original order. Figure 6.4 shows the expected modified final output of the Program 6.2. Answer the question 1) to (ii). li) Provide C++ statement for: (a) function CALL to originalOrder (3 marks) (b) function PROTOTYPE of originalOrder (3 marks) ) Provide C++ fragment codes for function definition of originalOrder (4 marks) 3. Compile and run the completed modified program of Figure 6.2. Type computer. when asked for input. The program is expected to produce the following output (Figure 6.4). Enter up to 10 characters. (Enter to stop the input): computer. Display in reverse order retupmoc Display in original order ------- computer Press any key to continue.. Figure 6.4: Expected output of modified Program 6.2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
