Skip to content

Instantly share code, notes, and snippets.

Exercises

  1. Write a function called billTotal that can be used to calculate the total to be paid at a restaurant -- including tip and tax -- given the subtotal (i.e. cost of food and drinks). We can assume that the tip will be 15% and tax will be 9.5%. Make sure that the tip does not include the tax!

  2. Complete the below function called range that takes two integers as parameters, start and end, and returns an array containing all the whole numbers between them starting with start and up to end (you can use a any loop. The function

@mmeigooni
mmeigooni / learning_resources.md
Created April 17, 2017 14:29 — forked from nathansmith/web-design-development-learning-resources.md
Resources for learning web design & front-end development

Module 2 Assessment

Sales Team

You are managing a sales team and you are interested is analyzing some data related to their age and total sales. Take a moment to review the following data structure you will be analyzing:

var salesTeam = [{name: {first: 'Aleen', last: 'Atkins'}, age: 26, sales: '$2314'},
 		{name: {first: 'Alvaro', last: 'Angelos'}, age: 55, sales: '$1668'},
 		{name: {first: 'Denese', last: 'Dossett'}, age: 29, sales: '$9248'},

Module 3 Assessment

This assessment is a recorded assessment. Before you start, please remember to start recording your screen. Please only submit your video and gist once you have completely finished your solutions!

Time limit: 1 hour

Part 1

Write a function that takes 3 words and returns a single count of all their letters.

Submitting your work

The workflow for submitting this will be a little different than last time. After recording your video:

// Data type
// Examples: String, number, boolean
// Data structure
// Examples: arrays, objects
var firstName = "Ram";
var age = "30";
var library = {
books: {
orwell: ['1984', 'animal farm'],
hemingway: ['A Farewell to Arms', 'The Old Man and the Sea', 'The Sun Also Rises']
},
plays: {
shakespeare: ['romeo and juliet', 'macbeth']
}
};

Set A:

Prompts

//1. collectKeys takes an object and returns an array filled with all of they keys inside of the collection.

Example:

  var obj = {course: 'Reactor Prep', best: true};
 collectKeys(obj) // ['course', 'best'];

Set B:

Prompts

//1. extendObject takes in an object, property, and value as parameters and adds the property and value to the object. If the property already exists, overwrite its current value with the new value. Return the object to the user.

Example:

Set C

Prompt

//1. Write a function that checks if the given input is an object.

After prompt number 1, you are given this :

function assert(expectedBehavior, descriptionOfCorrectBehavior) {
  if (!expectedBehavior) {
    console.log(descriptionOfCorrectBehavior);