ICSE Computer Science Java Programs | IT Developer
IT Developer

Java Programs - Solved 2011 ICSE Computer Science Paper



Share with a Friend

Solved 2011 ICSE Computer Science Paper

Class 10 - ICSE Computer Science Solved Papers

New Word by replacing Vowels with the next Character Program - ICSE 2011 Computer Science

Write a program to accept a word and convert it into lowercase if it is in uppercase, and display the new word by replacing only the vowels with the character following it.
Example:
Sample Input: computer
Sample Output: cpmpvtfr

import java.util.Scanner; class Replace{ public static void main(String args[]){ Scanner in = new Scanner(System.in); System.out.print("Enter the word: "); String w = in.next().toLowerCase(); String c = ""; for(int i = 0; i < w.length(); i++){ char ch = w.charAt(i); if("aeiou".indexOf(ch) >= 0) ch++; c += ch; } System.out.println(c); } }

Output

 
 OUTPUT  : 
Enter the word: computer
cpmpvtfr