<commit_before>Exercise 11: Asking Questions
=============================

Now it is time to pick up the pace. I have got you doing a lot of
printing so that you get used to typing simple things, but those simple
things are fairly boring. What we want to do now is get data into your
programs. This is a little tricky because you have learn to do two
things that may not make sense right away, but trust me and do it
anyway. It will make sense in a few exercises.

Most of what software does is the following:

1. Take some kind of input from a person.
2. Change it.
3. Print out something to show how it changed.

So far you have only been printing, but you haven't been able to get any
input from a person, or change it. You may not even know what "input"
means, so rather than talk about it, let's have you do some and see if
you get it. Next exercise we'll do more to explain it.

.. literalinclude:: ex/ex11.rb
    :language: ruby
    :linenos:

.. note::

    Notice that we are using ``print`` instead of ``puts`` to
    do the prompting. ``print`` doesn't add a new line automatically, so
    your answer can go on the same line as the question. ``puts`` on the
    other hand, adds a newline automatically.

What You Should See
-------------------

.. code-block:: console

    $ ruby ex11.rb
    How old are you? 35
    How tall are you? 6'2"
    How much do you weigh?  180lbs
    So, you're '35' old, '6'2"' tall and '180lbs' heavy. 
    $

Extra Credit
------------

1. Go online and find out what Rubys ``gets`` and ``chomp`` methods do.
2. Can you find other ways to use ``gets.chomp``? Try some of the
   samples you find.
3. Write another "form" like this to ask some other questions.

<commit_msg>Error in the output of ex11.<commit_after>Exercise 11: Asking Questions
=============================

Now it is time to pick up the pace. I have got you doing a lot of
printing so that you get used to typing simple things, but those simple
things are fairly boring. What we want to do now is get data into your
programs. This is a little tricky because you have learn to do two
things that may not make sense right away, but trust me and do it
anyway. It will make sense in a few exercises.

Most of what software does is the following:

1. Take some kind of input from a person.
2. Change it.
3. Print out something to show how it changed.

So far you have only been printing, but you haven't been able to get any
input from a person, or change it. You may not even know what "input"
means, so rather than talk about it, let's have you do some and see if
you get it. Next exercise we'll do more to explain it.

.. literalinclude:: ex/ex11.rb
    :language: ruby
    :linenos:

.. note::

    Notice that we are using ``print`` instead of ``puts`` to
    do the prompting. ``print`` doesn't add a new line automatically, so
    your answer can go on the same line as the question. ``puts`` on the
    other hand, adds a newline automatically.

What You Should See
-------------------

.. code-block:: console

    $ ruby ex11.rb
    How old are you? 35
    How tall are you? 6'2"
    How much do you weigh?  180lbs
    So, you're 35 old, 6'2" tall and 180lbs heavy. 
    $

Extra Credit
------------

1. Go online and find out what Rubys ``gets`` and ``chomp`` methods do.
2. Can you find other ways to use ``gets.chomp``? Try some of the
   samples you find.
3. Write another "form" like this to ask some other questions.


{'fraction_non_alphanumeric': 0.0990990990990991, 'fraction_numerical': 0.015693112467306015, 'mean_word_length': 2.9608745684695053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6373803', 'n_tokens_mistral': 1029, 'n_tokens_neox': 964, 'n_words': 587}