Ruby Learning # 17 If Statements

I wave up If I'm hungry I eat breakfast

I leave my house if it's cloudy I bring an umbrella otherwise I bring sunglasses

Im at a restaurant if I want meat I order a steak otherwise if I want pasta I order spaghetti & meatballs otherwise I order a salad.

ismale = false

if ismale puts "You are male" else puts "You are not male" end

ismale = false istall = true

if ismale and istall puts "You are tall male" elsif ismale and !istall puts "You are a short male" elseif !ismale and istall puts "You are not male but are tall" else puts "You are not male or not tall" end

Recommended Posts

Ruby Learning # 17 If Statements
Ruby Learning # 18 If Statements (Con't)
Ruby learning 4
Ruby learning 5
Ruby learning 3
Ruby learning 2
Ruby learning 6
Ruby learning 1
Ruby Learning # 25 Comments
Ruby Learning # 13 Arrays
Ruby Learning # 1 Introduction
Ruby Learning # 14 Hashes
Ruby Learning # 33 Inheritance
Ruby Learning # 15 Methods
Ruby if, case
Ruby Learning # 30 Initialize Method
Ruby learning points (basic)
Ruby Learning # 29 Classes & Objects
Ruby Learning # 20 Case Expressions
Ruby Learning # 24 Exponent Method
About Ruby if statement
Ruby Learning # 21 While Loops
Ruby Learning # 31 Object Methods
Ruby Learning # 27 Writing Files
Ruby Learning # 35 Interactive Ruby (irb)
Ruby Learning # 9 Math & Numbers
[Ruby] Assign variables in conditional expressions in if statements.
Ruby Learning # 28 Handling Errors
Ruby Learning # 26 Reading Files
Ruby Learning # 23 For Loops
Ruby Learning # 16 Return Statement
Ruby Learning # 2 Drawing a Shape
Ruby on rails learning record -2020.10.03
Ruby on rails learning record -2020.10.04
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby on Rails basic learning ①
Java if and switch statements
Ruby Learning # 11 Building a Calculator
Ruby Learning # 99 Personal Programming Notebook
Ruby on rails learning record-2020.10.07 ②
Ruby Learning # 10 Getting User Input
Ruby Learning # 32 Building a Quiz
Ruby Learning # 8 Working With String
Ruby on rails learning record-2020.10.07 ①
[Ruby] problem with if statement
Ruby on rails learning record -2020.10.06
[Ruby] conditional branch if statement
Ruby Learning # 19 Building a Better Calculator
Completed Progate Ruby Learning Course III
Learning Ruby with AtCoder 6 [Contest 168 Therefore]
[Ruby] present/blank method and postfix if.
Completed Progate Ruby Learning Course II
Ruby Learning # 22 Building a Guessing Game
[Ruby] If and else problems-with operators-
[Java] Reduce if statements with Enum
Learning Ruby with AtCoder 7 [Contest 168 Triple Dots]
[Ruby] Exception handling, give back if given
Ruby Learning # 12 Building a Mad Libs Game
[Ruby] if statement concept of conditional expression