GithubHelp home page GithubHelp logo

javajava14 / say-hello-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-curriculum/say-hello-ruby

0.0 1.0 0.0 20 KB

A simple lab about methods and arguments

License: Other

Ruby 100.00%

say-hello-ruby's Introduction

Say Hello

Objectives

  1. Build a method that can be called with an optional argument by defining that method with a default argument.

Instructions

You will build a method called say_hello. This method should accept the argument of a person's name. It then should print "Hello " with the name followed by an exclamation point (don't forget that space after the "Hello"). For instance:

# I call on the method, say_hello, and give it the string "Gabriela" 
say_hello("Gabriela")

# The method prints this text to the screen:
Hello Gabriela!

There is one more thing this method should do: if you call on this method and forget to give it the name of a person, it should just say, "Hello Ruby Programmer!". Use a default argument to accomplish this!

Steps

  1. Run learn test to see where you stand.
  • You probably got two NoMethodErrors. This means the test was looking for a method called say_hello but couldn't find it.
  1. Define the method in say_hello.rb
  • Run learn test again. Are you getting a different error? If you haven't seen this error, guess what it's trying to tell you then Google it with the word "ruby".
  1. Get all the tests to pass!

say-hello-ruby's People

Contributors

kthffmn avatar sophiedebenedetto avatar annjohn avatar aviflombaum avatar markedwardmurray avatar maxwellbenton avatar ahimmelstoss avatar fs-lms-test-bot avatar graciemcguire avatar jmburges avatar javajava14 avatar msuzoagu avatar sarogers avatar fislabstest avatar timothylevi avatar ihollander avatar

Watchers

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