Activity 3 – Reversing a 'char' array (1) Write an applet that displays a char array called forward containing the letters: 'h' 'e' 'l' 'l' 'o'
The screen should look as follows when the appletviewer is executed: 
(2) Modify your applet so that a second char array, called backward, is created, that processes the elements of array forward, and places the reverse values into array backward. You should write this code to be general enough so that if the length or values inside forward are changed, your loop to put values into backward does not need to be changed. 
The screen should look as follows when executed: (3) Test how general your code is, by changing the characters that forward is initialised to. For example, try it with the initialisation: char forward[] = { 'I', 'N', 'T', '4', '1', '2', '0', ' ', 'J', 'a', 'v', 'a' };
When executed your screen should appear as follows: 
Discussion/Suggested solution to Activity 3 Back to content Back to top 
RITSEC - Global Campus Copyright ?1999 RITSEC- Middlesex University. All rights reserved. webmaster@globalcampus.com.eg |