Giter Site home page Giter Site logo

each-chapter's Introduction

Ruby Practice

Run your Ruby file by typing ruby and then the name of the file you want to run in the Terminal.

If we want to run each_even_word.rb, we can write the command:

ruby each_even_word.rb

To re-run this command, you can use the UP and DOWN arrow keys to look at the history of commands you've run in a Terminal.

Each

each_spell_word.rb

Write a program that:

Asks your user to enter any word and have it spelled out letter by letter.

Input Georgia

Output

"G"
"E"
"O"
"R"
"G"
"I"
"A"

Example

"Enter a word for me to spell:"
Georgia
"G"
"E"
"O"
"R"
"G"
"I"
"A"

each_even_word.rb

Write a program that: Asks the user to enter a list of words separated by spaces. The program should only print the words that are have an even number of characters

Example (mountain pink vines is the input)

"Enter a list of words separated by spaces:"
mountain pink vines
"mountain"
"pink"

each_letter_count.rb

Write a program that:

Asks the user to enter a word. The program should print each letter in the word the number of times it appears in the word.

Example input: loop

Output:

"Enter a word"
loop
l appears 1 times
o appears 2 times
o appears 2 times
p appears 1 times

Specs

Click here to see names of each test

each_spell_word.rb spells 'Georgia' correctly

each_spell_word.rb spells 'Supercalifragilisticexpialidocious' correctly

each_letter_count.rb prints the letters and number of times the letters appear for the word 'levee'

each_letter_count.rb prints the letters and number of times the letters appear for the word 'loop'

each_even_word.rb prints the 'mountain' and 'pink' when the input is 'mountain pink vines'

each_even_word.rb prints nothing when the input is 'odd numbers squad'

each-chapter's People

Contributors

jelaniwoods avatar bpurinton avatar pmckernin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.