TCS Coding 1. The program will recieve 3 English words inputs from STDIN These three words will be read one at a time, in three separate line

1. The program will recieve 3 English words inputs from STDIN

  1. These three words will be read one at a time, in three separate line
  2. The first word should be changed like all vowels should be replaced by *
  3. The second word should be changed like all consonants should be replaced by @
  4. The third word should be changed like all char should be converted to upper case
  5. Then concatenate the three words and print them

Other than these concatenated word, no other characters/string should or message should be written to STDOUT

For example if you print how are you then output should be h*wa@eYOU.

You can assume that input of each word will not exceed more than 5 chars

Test Cases

Case 1

Input

  • how
  • are
  • you

Expected Output : h*wa@eYOU

Case 2

Input

  • how
  • 999
  • you

Expected Output : h*w999YOU

94 comments on “TCS Coding 1. The program will recieve 3 English words inputs from STDIN These three words will be read one at a time, in three separate line”


  • MADEM

    import java.util.*;
    public class Main
    {
    public static void main(String[] args) {
    System.out.println(“Hello World”);
    Scanner sc=new Scanner(System.in);
    String word1=sc.nextLine();
    String word2=sc.nextLine();
    String word3=sc.nextLine();
    System.out.println(“Expected Output: ” + word1.replaceAll(“[aeiouAEIOU]”, “*”) + word2.replaceAll(“[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]”, “@”) + word3.toUpperCase());

    }
    }