java

Write a Program to take a string, convert it in uppercase and replace all vowel of string with the character followed by vowel and replace the first letter with last letter and print the new string in JAVA

Write a Program to take a string, convert it in uppercase and replace all vowel of string with the character followed by vowel and replace the first letter with last letter and print the new string in JAVA.

java

Write a Program to take a string, convert it in uppercase and replace all vowel of string with the character followed by vowel and replace the first letter with last letter and print the new string in JAVA.

Input String : COMPUTER

OUTPUT STRING 1 : CPMPVTFR

OUTPUT STRING 2 : ROMPUTEC

package com.company;

import java.util.Scanner;

public class StringProg1
{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = "" , str1 = "" , str2 = "";
        System.out.println("Input String : ");
        str = sc.nextLine();
        str = str.toUpperCase();
        System.out.println("String Entered : " + str );
        int l = str.length();
        char ch;
        for( int i = 0 ; i < str.length() ; i++ )
        {
            ch = str.charAt(i);
            if( ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' )
            {
                ch++;
            }
            str1 = str1 + ch;
        }

        System.out.println("String 1 : " + str1);

        str2 = str.charAt(l-1) + str.substring(1,l-1) + str.charAt(0) ;

        System.out.println("String 2 : " + str2);

    }
}



 


 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

πŸ§‘β€πŸ’»πŸ§‘β€πŸ’»Β Social MediaΒ LinksΒ ofΒ Tech DCodeΒ :

πŸ‘‰πŸ» YouTube :Β https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
πŸ‘‰πŸ» Instagram :Β https://www.instagram.com/thetechdcode/
πŸ‘‰πŸ» Facebook Page :Β https://www.facebook.com/thetechdcode
πŸ‘‰πŸ» Twitter :Β https://twitter.com/thetechdcode
πŸ‘‰πŸ» Telegram Channel :Β https://t.me/thetechdcode
πŸ‘‰πŸ» Tech DCode Linktree :Β https://linktr.ee/thetechdcode
πŸ‘‰πŸ» My Personal Handles :Β https://linktr.ee/virtualshivamin

πŸ§‘β€πŸ’»πŸ§‘β€πŸ’»Β Social Media LinksΒ ofΒ SHIVAM SINGHΒ (OWNER) :

πŸ‘‰πŸ» Instagram :Β https://www.instagram.com/virtualshivamin/
πŸ‘‰πŸ» Facebook Page :Β https://www.facebook.com/virtualshivamin/
πŸ‘‰πŸ» Twitter :Β https://twitter.com/virtualshivamin/
πŸ‘‰πŸ» Personal Linktree :Β https://linktr.ee/virtualshivaminΒ 

Leave a Reply

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