Media Computation Skills Lab

MTEC 1003

Lab 7 / Part 1 - JavaScript Conditionals

In this lab, you’ll be creating several programs:

  1. cake
  2. spanish
  3. odd calculator

Instructions

Setup

ProTip: Bookmark the following page so that you can easily repeat these steps in your future labs!

Cloning a Remote Repo Using Your GitHub API Access Token


cake

Write a program that asks the user if they want cake. Based on their response, it should output a different message to the JavaScript Console.

# Run 1
(prompt) Do you want cake?
> yes
Have some cake.
# Run 2
(prompt) Do you want cake?
> maybe
No cake for you.
# Run 1
(prompt) Do you want cake?
> no
No cake for you
# Run 2
(prompt) Do you want cake?
> maybe
I don't understand

spanish

Write a program that translates english words to Spanish.

# Run 1
(prompt) Give me a word in English...
> gato
cat
# Run 2
(prompt) Give me a word in English...
> bear
no entiendo

odd calculator — oddcalc.html

Prompt the user for a number.

Prompt the user for another number.

Ask the user what kind of operation they want to do - mul, div, or mod.


MTEC 1003 - Media Computation Skills Lab