InterviewSolution
Saved Bookmarks
| 1. |
A Metropolitan Hotel has 5 floors and 10 rooms in each floor. The names of the visitors are entered in a Double Dimensional Array (DDA) as M[5][10].The Hotel Manager wants to know from the "Enquiry" about the position of a visitor (i.e. floor number and room number) as soon as he enters the name of the visitor. Write a program in Java to perform the above task. |
|
Answer» m[5][10];int i,J;for(i=0;i<5;i++){for(j=0;j<10;j++){m[i][j]=br.readLine();System.out.println("Floor"+i+"Room"+j+"NAME:"+m[i][j]);}} |
|