Skip to content

One of my initial code challenges that instilled a sense of confidence in myself.

Notifications You must be signed in to change notification settings

jwhy89/breakfast-object-code-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Breakfast Object Code Challenge (updated 190519)

You are responsible for making breakfast for a group of 4 picky eaters. If you can't feed them, you will have to go out to eat. Ideally, you want to eat at home (it's less expensive), but you'd rather go out to eat than listen to them whine.

Here are the demands from the picky eaters:

  1. They all want to eat the same thing.
  2. They each want 2 eggs and 3 slices of bacon OR 3 chocolate chip pancakes.

A few notes:

  • A bag of pancake mix can make 10 pancakes.
  • A pancake must have at least 15 chocolate chips to be chocolatey enough for the picky eaters.

Your function breakfastChecker should be able to determine if a single object with a list of supplies has enough ingredients (contents) to make breakfast. You do not need to worry about multiple objects (you will make breakfast from only ingredients in the refrigerator OR pantry).

Be sure to change the values in the objects to test your function in multiple conditions.

Hint: Just check eggs and bacon first. Take small steps!

Stretch

The picky eaters might invite some picky friends, but you won't know until seconds before you have to make a decision. Allow the function to accept a second parameter - the total number of picky eaters - to allow you to make the calculation at the last second.

Built With

  • JavaScript
  • Node.js
  • HTML

Getting Started

These instructions will get you a copy of the code challenge solution and run it on your local machine for development and testing purposes.

Prerequisites

Link to software that is required before you attempt to start the app (e.g. node, mongo).

Installing

Steps to test the solution.

  1. Download this project.
  2. In terminal, navigate to your project folder and type node client.js
  3. You should see that Node.js has ran the client.js file and will display the console log scripts.
  4. Feel free to update the variables in pantryContents, refrigeratorContents, and eaters to come up with other test conditions.

Completed Features

  • Set up variables for each condition outlined in the code challenge.
  • Set up an eater's varable for the stretch goal.

Next Steps

  • Create a client.test.js file to further test.

Authors

  • Jarvis Yang

About

One of my initial code challenges that instilled a sense of confidence in myself.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published