Git Product home page Git Product logo

upperline-hs-mothers-day-upperline-trevor-062016's Introduction

Mother's Day!

Intro

Mother's day is coming up, and you've been hired by Hallmark to develop some e-cards! We're going to write some methods to wish people Happy Mother's Day for us. You'll be coding your solutions in lib/mothers_day.rb.

Step 1 - a method with no arguments

Define a method, mothers_day, that returns a string that says "Happy Mother's Day, Mom!"

Step 2 - a method with arguments

Your mothers day method is great, but it can only wish a Happy Mother's Day to Mom! Some of your customers want to wish a Happy Mother's Day to their grandmothers, sisters, and friends. Update your method so that it takes in a name and returns a personalized greeting. For example, calling mothers_day("Beyonce") should return "Happy Mother's Day, Beyonce!"

Step 3 - a method with default arguments

Your new method is great, but there's just one problem - all of the people who wanted to say "Happy Mother's Day, Mom!" now have broken programs! They're calling mothers_day without any arguments, and we've changed our method to accept one argument. We can fix this by giving our argument a default value. Update your mothers_day method so that calling mothers_day returns "Happy Mother's Day, Mom!" and mothers_day("Beyonce") returns "Happy Mother's Day, Beyonce!"

Step 4 - multiple arguments and more

Our method now works great for mother's day, but we want to let users customize it even more. Create a new file, holiday_greeting.rb and write a method that takes in a to, from, and a holiday and returns a personalized greeting. For example, calling holiday_greeting("Beyonce", "Jay-Z", "Fourth of July") should return "Happy Fourth of July, Beyonce! - From Jay-Z". If no arguments are specified, the method should return "Happy Mother's Day, Mom! From Your Favorite Child"

Bonus

  • Create a file in this directory called holiday_greeting.rb. First build out a command line user interface. It should
    • Welcome the user to your program
    • Take in their to, from, and holiday inputs and store them in variables.
    • Run your method and show the user your results!

View Mother's Day! on Learn.co and start learning to code for free.

upperline-hs-mothers-day-upperline-trevor-062016's People

Contributors

drabgrey95 avatar dfenjves 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.