Javascript Video Tutorials: Numeric Functions

Pubblicato il: 29 luglio 2018
sul canale di: FreeCodeTube
120
1

http://freecodetubes.com/react/javasc...
Create some numeric functions as follow:

Write a function called squareNumber that will take one argument (a number), square that number, and return the result. It should also log a string like “The result of squaring the number 3 is 9.”
Write a function called halfNumber that will take one argument (a number), divide it by 2, and return the result. It should also log a string like “Half of 5 is 2.5.”.
Write a function called percentOf that will take two numbers, figure out what percent the first number represents of the second number, and return the result. It should also log a string like “2 is 50% of 4.”
Write a function called areaOfCircle that will take one argument (the radius), calculate the area based on that, and return the result. It should also log a string like “The area for a circle with radius 2 is 12.566370614359172.”
Bonus: Round the result so there are only two digits after the decimal.
Write a function that will take one argument (a number) and perform the following operations, using the functions you wrote earlier1:
Take half of the number and store the result.
Square the result of #1 and store that result.
Calculate the area of a circle with the result of #2 as the radius.
Calculate what percentage that area is of the squared result (#3).


In questa pagina del sito puoi guardare il video online Javascript Video Tutorials: Numeric Functions della durata di ore minuti seconda in buona qualità , che l'utente ha caricato FreeCodeTube 29 luglio 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 120 volte e gli è piaciuto 1 spettatori. Buona visione!