Computer Science, asked by polavarapupavani1, 1 year ago

Write a method that takes as paramater an integer. This integer is a 2 digit number.

Depending on the value of the number, print the English word for this number.

The Met method has to be inside a Solution class. Please check the code editor for the ideal method definition.

Example Input: 45
Output: forty-five
Example Input: 13
Output: thirteen
Example Input: 87
Output: eighty-seven

Answers

Answered by goutamipurra
0

Answer:

class Solution {

 public static void Met(int n){

   switch(n){

      case 10:

       System.out.println("ten");

      break;

       case 11:

       System.out.println("eleven");

      break;

       case 12:

       System.out.println("twelve");

        break;

       case 13:

      System.out.println("thirteen");

       break;

       case 14:

        System.out.println("fourteen");

       break;

       default:

           System.out.println();

           break;

   }  

 }

}

Explanation:

Similar questions