COMP1073 Assignment 1-JavaScript & Coffee! Solved

30.00 $

Category:

Description

5/5 - (1 vote)

 

In Module One, we started to really get to know the basics of JavaScript – variables, variable scope, data types, arrays, functions, conditional statements, loops, and objects. We also focused on debugging our JavaScript and best practices to apply when crafting our code. 

Your Task: 

Using the knowledge you’ve gained in Module One, complete the following:

Instructions : 

  1. Create an object literal to represent a coffee order that a customer might place. Your coffee object should contain the following properties: customer name, type of drink (i.e. latte, coffee, expresso), size of coffee (short, tall, grande, venti) , drizzle (yes or no) ,whipped cream (yes or no) , sweetener (yes or no), cold foam (yes or no) and dairy (cream, 2% milk, almond milk).
  2. In your object literal, include a method to display the coffee order information in an alert box. Drizzle, whipped cream, sweetener and cold foam should only be displayed if they are included in the customer order

(i.e. yes).

  1. Ask a friend how they take their coffee. Create a second object literal to represent this coffee order.
  2. Ensure your code is valid, efficient, follows best practices and is formatted correctly!
  3. Publish your page on a web server (AWS, Github pages or your own web server).
  4. Create a short code review screencast in which you review and explain your code. You can use YouTube, Flipgrid or any other platform you have access to in order to create this screencast.

TAKE IT FURTHER

  • Have the users coffee order displayed in the browser window (not in an alert) without using document.write.
  • Explore constructor functions and use constructor functions instead of object literals to complete this exercise.

Project Objectives:  

  • construct a variety of programming structures including variables, constants, arrays, objects, functions, conditionals, and constructors;
  • test and debug scripts using validators, DOM inspectors, and error console tools
  • optimize code for increased functionality, performance, readability, and reusability;
  • assignment1-nz96wp.zip