varunsingh87 / order.js

A JavaScript program taking the pizza order of multiple customers

Home Page:https://borumer.github.io/order.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Order.js is the first ES6 program (through the console) I have made that is hosted on GitHub through Git workflow. The person takes an order through a function call and the price is calculated based on what they ordered and how many items.

This is a program in which you take an order with nested functions with the arguments including topping, crust type, quantity, how-well-roasted, name-of-drink, and size. The price is calculated. Based on the number of orders in a group of customers, the total group order price is calculated.

A function declaration calculates sub total, adds 6% tax, and prints the total in US Dollars. The total is calculated by adding the total side cost - a constant integer price per side - and the total meal cost - a constant integer price per meal. When you call the group order function, you pass every customers' order as a value of the array, the one and only argument of the group order function call. You can take different types of food orders by calling different functions for the take order.

In the new version of the app, the destructuring technique is used. In each of the functions for the orders listed below, the argument is an object. In the function, the object properties are referred to as if they are regular parameters. This is achieved by wrapping the properties in curly braces in the parameter list, called destructuring.

The following are the current options to order food and drinks:

  • pizza
  • hot dog
  • fries
  • drink
  • burger
<script> let sslink = document.createElement("link"); sslink.href = "css/normalize.css"; sslink.rel = "stylesheet"; sslink.type = "text/css"; document.head.appendChild(sslink); let favLink = document.createElement("link"); favLink.rel = "shortcut icon"; favLink.type = "images/x-icon"; favLink.href = "images/icon.ico"; document.head.appendChild(favLink); </script>

About

A JavaScript program taking the pizza order of multiple customers

https://borumer.github.io/order.js/

License:Apache License 2.0


Languages

Language:JavaScript 59.5%Language:HTML 35.8%Language:CSS 4.7%