Q:

Concept of variable

For a beginner
Is it right to use the concept of hotel room and passenger as an analogy to explain the concept of variable? 

A:

Why complicate matters with contrived analogies like hotel rooms and guests? 
It is much more straightforward to take the analogy of a simple paper "form" (which absolutely everyone in contact with the Western world has used and understands), and understand that there are spaces or "boxes" on the form which are referred to by names.  The person completing the form enters data into those boxes.  Additionally, there exists Tippex, and the data in any given box can usually be overwritten - with computers moreso than with paper, overwriting is common.  The content of a box - the thing written into it (or the absence of any entry) - is generically called the "value". 
The boxes in this paper analogy are the equivalent of computer variables.  The declaration of a variable is the equivalent to defining a new box - that is, allocating space on the form and providing that space with an associated name. 
This analogy of a paper bureaucracy fully extends to all other computer concepts. 
A function call, for example, is the summoning of another form from the shelf.  We transfer certain "input" values from the existing form to this new form.  We then perform a set of calculations,.or other administrative operations (like gathering other stored data, searching filing cabinets, etc.),  and finally we arrive at a set of "return" values which are transferred back to the existing form, and the "new" form is then thrown in the bin. 
I often think a serious deficit in modern IT teaching and discourse, is that too few people are taught basic administrative principles and their equivalent implementations using paper. 

A:

The use of an analogy is to provide a familiar jumping-off point to introduce something new.  Since variables are unique features of computing systems, different from how anything else in the universe functions, we need some way to cross the gap.  Let's look at how useful the analogy of hotel room and guest is, bearing in mind that most analogies do not survive contact with the students, for more than a few minutes. 
The essential feature of this analogy is that you have a fixed thing, the room, which can have different contents: varying guests over time.  Good.  The very first thing out of a student's mouth
(or keyboard) is likely to be: "can there be multiple guests in a room?"  Hooray!  Thinking!  This was the objective. 
Yes, you could use a One Dimensional Array (please do not call it a vector, which means something quite different to most students), or you could use a List.  Quick explanation there...
Next idea: There is more than one room in most hotels!  If you look at the building from outside, you see a two dimensional array of rooms, usually.  The analogy hardly even needs for this idea to be broached, it just falls right out of the image.  So, yes: a computer is basically a vast rectangle of boxes to put values in.  Modern computers allow for different sized and shaped boxes, and even on-the-fly shapes like something conveyed with XML. 
Hotel rooms have identifying information.  In retreat centers, the rooms can have names, often the names of flowers or something.  For computers -- which are essentially mathematical -- we just use numerical addresses.  But names are so handy, so we layer those on top.  We can define any old names for our any old arrangement of any sized boxes. 
Now the analogy runs out of steam (or gasoline, or battery, or protons...) and we have introduced the subject in a way that students can visualize and therefore, hopefully let go of the nuts in the Southeast Asian Monkey Trap and move on.  Some one of them might "continue writing the figure '1' " and you have another Ramanujan on your hands, but it is unlikely. 
In 8th grade, over 40 years ago, my math teacher wheeled a Teletype to the front of the room and proceeded to explain about computer memory and variables, and then we connected to the School System's computer (the Police Department had one too, it was pretty exciting) and we created simple programs and stored them on paper tape.  The essential facts about computers have not changed, because they can't. 
The other answers made good points about naming and paper forms, so those should be mentioned also.  But computers, variables, programs... are not like anything else, and that is why we have them, otherwise we would just have the other things instead.  Because computers are so singular and incredible, we need to explain how they actually work, not paper over that.  A construction worker who could only pick out wallpaper would not be much use when it came to building walls, putting in wiring and plumbing and so on. 
And because those who do not learn from the history of computer system development are doomed to wander in the wilderness for 40 years.  Other people have made a lot of the mistakes for you!  Learn why they made those mistakes.  Most likely, it is because they took some fixed idea they had too far, and couldn't make themselves agree with other people about stupid things like big-endian vs little-endian, which should never have been a thing.  If you pick up the analogy by the pointy end, you can get fatally bitten by it. 

A:

You can also use @Steve paper form idea for a second use, namely the importance of naming.  I have often given students a paper form with boxes of different lengths, labeled A, B, C, etc.  I then explain that their ability to fill in the form correctly (with information about themselves) will account for 50% of their final grade.  Of course, they immediately ask "What goes in each box?" 
Instead of answering directly, I show them a sample form already filled in.  I use values that look like first/last name, but use names which could easily be either a first name or last name (e.g. Thomas/Kelly).  Between the names there is a short box containing a single letter A. Middle initial, right!  The idea is to demonstrate that even given data values, one is never certain what that value is.  The name must convey to the reader what the value is.  At the end, I show a form with appropriate labels for each box.  For the short box, the label is "Grade I hope to get". 
This can be augmented by taking a short piece of code (I like to use quadratic equation), and obfuscate with names that look like Dr Seuss made up words.  I ask them to explain what the code does.  It is difficult when the variable names have no meaning in connection to the problem.  I explain that their own code will become equally unfathomable unless they choose good names.  Furthermore, asking the instructor for help solving a problem will be difficult if the instructor can not read/understand their code. 
public class Seuss { // with apologies to Dr Seuss and John Lennon

  public static double snuvs(String s) { return Double.parseDouble(s); }

  public static void main(String[] jlbboo) {

    int lorax=0, quimney=2;
    double beft, obsk, kweet, zong, lerkim, skirtz;

    beft   = -snuvs(jlbboo[1]);
    kweet  =  snuvs(jlbboo[quimney]);
    obsk   =  snuvs(jlbboo[lorax]);
    zong   =  obsk * quimney;
    lerkim =  beft * beft;
    skirtz =  lerkim - zong * kweet / 0.5;
    beft  /=  zong;

    if (skirtz < lorax)
      System.out.println("Imagine the two numbers\nIt's easy if you try");
    else if (skirtz == lorax)
      System.out.println(beft);
    else {
      skirtz = Math.pow(skirtz, 1.0/quimney)/zong;
      System.out.println((beft+skirtz) + "," + (beft - skirtz));
    }
  }
}

