-
-
Save SOliv1/39beff2968af02c1a2434f2274490ed4 to your computer and use it in GitHub Desktop.
Java script excercises - Code Academy |
Truthy or Falsy
See Code Academy Forums my comments in Code Academy Forums
Fix the broken code
Tip Calculator
toEmoticon
Life Phase
Secret Message
Whale Speak - Loops
Once we have converted text to the whale language, the result is sung slowly, as is a custom in the ocean.
To accomplish this translation, we can use our knowledge of loops. Let’s get started!
Meal Maker
In this project we use JavaScript to randomly create a three-course meal based on what is available on a menu. We’ll keep running it until we’re satisfied with the generated meal!
Meal Maker - Using javascript
We use JavaScript to randomly create a three-course meal based on what is available on a menu. We’ll keep running it until we’re satisfied with the generated meal!
Team Stats
We create and extract information about our favorite sports team. Basketball, soccer, tennis, or water polo, we pick it. It’s our job to create data using the JavaScript data structures at our disposal: arrays, objects, etc.
Once created, we can manipulate these data structures as well as gain insights from them. For example, we might want to get the total number of games our team has played, or the average score of all of their games.
Greet Aliens
###Using decrement and increment
What does i++ and i-- mean?
decrement and increment
Convert To Baby
Using decrement and increment
What does i++ and i-- mean?
decrement and increment
Fix the broken code
In the above exercise the there was a scope error. Please read this excellent explanation relating to the exercise on Code Academy Forum
Also checkout What is Scope
[ ] smallestPowerOfTwo() function was not working to get the desired results, because we needed to add a new variable (J) to return the desired results of the smallest number two which is greater than the current element before using .push() to add it to results.
Sort Years
sortYears() - takes in an array of years, and, uses the built-in .sort() method, returns that array with the years sorted in descending order.
We test our function when ready by passing in the years array or by making our own array of years!
Just Cool Stuff
just Cool Stuff - takes in two arrays of strings, and, uses the built-in .filter() method, returns an array with the items that are present in both arrays.
Number Of Teeth
This exercise sorts the average number of teeth that species possesses (numTeeth) .
Find My Keys
Here is an array of strings which may or may not contain 'keys'. If the keys are in the array, our function should return the index at which they can be found. If they’re not in the array, our function should return -1.
Dog Factory
Code Acadamy Forum Question:
Why are getters and setters important?
Answer
Getters and setters are important to use when we want to perform some operation on data before we view or save said data. Getters and setters are also important to use when we want to make sure we don’t override data unintentionally, by making that data accessible only through our getters and setters
Credit Card Checker
Checks whether credit cards are valid or not.
Work Around Explorer
What is it about
WorkAround is a research organization providing data on salary trends in the tech industry. Open up salaryData.js to see the data they have collected. You’ll notice that they have also created a few functions for filtering that data to get subsets of data by role and by company.
WorkAround wants to release a new web application called WorkAround Explorer to make their data more easily viewable.
This web app should allow users to choose specific roles and companies in the tech industry to see the following information:
- The salary for the chosen role at the chosen company.
- The industry average for the chosen role.
- The average salary at the chosen company across all roles.
- The industry average salary across all roles and all companies.
Find My Hat
##User Input Output Number Guess Game
inputOutput
Create my own port with node
Building and designing a database
Calculate earth weight of the following planets:
Calculate the weight of the planets
Though an object’s mass remains consistent throughout the universe, weight is determined by the force of gravity on an object. Since different planets have different gravity, the same object would weigh different amounts on each of those planets! Cool, huh?