Giter Site home page Giter Site logo

more-vowels's Introduction

More Vowels

Skills: Control Flow, Creativity

Instructions

Let's go back to the exercise where we determined what is and is not a vowel. With Ruby, there's always more than one way to do something and get the same result. (TIMTOWTDI, kids.)

For the purposes of this exercise, we are assuming the vowels are a, e, i, o, and u. Sorry, 'y'.

  1. Write a method that returns whether a given letter is a vowel, using if and elsif.

  2. Write a method that returns whether a given letter is a vowel, using a case statement.

  3. Write a method that returns whether a given letter is a vowel without using if or case while all on a single line.

  4. Write a method that returns whether a given letter is a vowel without checking equality, or the use of if. Hint: use an array of vowels.

  5. Write a method that returns whether a given letter is a vower using the ternary operator.

  6. Write a method that will evaluate a string and return the first vowel found in the string, if any.

  7. Write a method that will evaluate a string and return the ordinal position (index) of the string where the first vowel is found, if any.

Hint: remember that every line of Ruby code has a return value, and that a method will return the result of the last operation.

View More Vowels on Learn.co and start learning to code for free.

more-vowels's People

Contributors

loganhasson avatar scottcreynolds avatar kthffmn avatar arelenglish avatar sarogers avatar fislabstest avatar ahimmelstoss avatar fs-lms-test-bot avatar mrmitchboyer avatar

Watchers

James Cloos avatar  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.