whohas3E / In-Class__Conditionals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exercises: Conditionals

What number's bigger?

Write an if statement that compares two numbers (call them numOne and numTwo).

If numOne is bigger, it should log to the console "numOne (THE VALUE) is bigger than numTwo (THE VALUE)".

If numTwo is bigger, it should log to the console "numOne (THE VALUE) is smaller than numTwo (THE VALUE)".

If they are even, it should log to the console "numOne (THE VALUE) is equal to numTwo (THE VALUE)".

Driving Age

Store the user's name and age.

  • If the age is less than 16, log "Sorry, you can't drive yet!"
  • If the age is greater than or equal to 16, log "Drive into the sunset!"

Bonus: Get the name and age using prompt!

Bonus: If the user can't drive yet, tell them how many years they have before they can drive (e.g. "Sorry, you still have 4 years before you can drive")

About


Languages

Language:CSS 62.0%Language:JavaScript 27.4%Language:HTML 10.6%