Javascript
Module 4 Overview
In this fourth and final module, the programming language covered was Javascript. The tutorial from Codecademy and W3Schools were used to explain how Javascript functions within webpages and how it operates. The tutorials covered basic syntax, functions, statments, loops, and more. This module was shorter than the other three and contained only two assignments. The W3Schools Javascript quiz was helpful in preparing for the exam in module four.
Learning Narrative
The Codecademy Javascript tutorial was extremly helpful in helping me understand the programming language. I've always like Codecademy's interactive tutorials and I was pleased to go through it again with Javascript. Although this module wwas a short, I enjoyed Javascript more than the other langauges covered in the other modules due to how importantly it affects webpages. The W3Schools Javascript quiz is always good practice to have in preparing for this module and I also think the quiz really benefited me when taking exam four. My best assignment from this module is below.
Selected Assignments
In this Codecademy Javascript tutorial, I created an if statement with else if. It prints a certain string based on the condition, in this case, which type of moon phase is given. I printed the string with console.log and used/ created the variable "moonPhase". Since the condition did not equal to the ones given, the else statement prints invalid moon phase. The image below is a screenshot of the tutorial.
In this Codecademy Javascript tutorial, I created a program that takes a pizza order. The parameters used in this function are "pizza topping" and "type of crust". A few other functions were also created to calculate the tax and total cost of the pizza. I learned how return statemnts worked in this example. 3 pizzas were ordered and the total was 23.85 after tax. The image below is a screenshot of the code.
In this Codecademy Javascript tutorial, I created a while loop that guessed the suit of a card. I created an array that contained 4 suits:
Diamond, Spade, Heart, and Club. The randomized suit selected was a Heart but the suit guessed was a Spade. I created other variables such as "randomNumber" to produce the random suit from the array. The image below is a screenshot of the code.
Here is the link to Codecademy.