Just my random coding struggles with some hip hop sprinkled in #vitalgroundz. While your here click a Ad or two.
Showing posts with label algorithm. Show all posts
Showing posts with label algorithm. Show all posts
Monday, April 1, 2019
Wednesday, March 27, 2019
Basic Algorithm Scripting: Slice and Splice
Basic Algorithm Scripting: Slice and Splice
You are given two arrays and an index.
Use the array methods slice and splice to copy each element of the first array into the second array, in order.
Begin inserting elements at index n of the second array.
Return the resulting array. The input arrays should remain the same after the function runs.
Saturday, March 16, 2019
Sunday, March 3, 2019
Basic Algorithm Scripting: Finders Keepers
Basic Algorithm Scripting: Finders Keepers
Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument). If no element passes the test, return undefined.
Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.
Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument). If no element passes the test, return undefined.
Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.
Tuesday, February 12, 2019
Basic Algorithm Scripting: Reverse a String
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use Read-Search-Ask if you get stuck. Write your own code.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use Read-Search-Ask if you get stuck. Write your own code.
Here i first split the string so as it will read: "j r p e r i o d" The reverse the string: "d o i r e p r j" the join the revered string: "doireprj"
Saturday, February 2, 2019
Basic Algorithm Scripting: Convert Celsius to Fahrenheit
The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.
You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and assign it the Fahrenheit temperature equivalent to the given Celsius temperature. Use the algorithm mentioned above to help convert the Celsius temperature to Fahrenheit.
Don't worry too much about the function and return statements as they will be covered in future challenges. For now, only use operators that you have already learned.
You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and assign it the Fahrenheit temperature equivalent to the given Celsius temperature. Use the algorithm mentioned above to help convert the Celsius temperature to Fahrenheit.
Don't worry too much about the function and return statements as they will be covered in future challenges. For now, only use operators that you have already learned.
Subscribe to:
Posts (Atom)





