Working with Built-in Math Functions
Welcome to the "Working with Built-in Math Functions" Practice Lab. In this module, you will be provided with the instructions and devices needed to develop your hands-on skills.
Welcome to the Working with Built-in Math Functions Practice Lab. In this module, you will be provided with the instructions and devices needed to develop your hands-on skills.
The following exam objective is covered in this lab:
- 2.4 Complete and debug code that uses built-in Math functions
It will take approximately 30 minutes to complete this lab.
Exercise 1 - Using Built-in Math Object Methods
- Math.abs(x) - This method returns the positive value of the parameter value.
- Math.round(x) - This method rounds off the parameter value to its nearest integer.
- Math.ceil(x) - This method rounds off the parameter value upwards to its nearest integer.
- Math.random() - This method generates random values that are less than 1 but greater than or equal to 0.
- Math.floor(x) - This method rounds off the parameter value downwards to its nearest integer.
For the purpose of this demonstration, the calculator application does not accept negative numbers. Therefore, the method Math.abs(x) is not included in the application.
You will perform the following tasks:
- Task 1 - You will download the Visual Studio Code workspace (Calculator) from the Intranet and open the HTML page named Calc.html in the Calculator workspace.
After completing this exercise, you will be able to:
IT & Cybersecurity certification hands on practice labs and practice exams for certifications and skill development.
See the full benefits of our immersive learning experience with interactive courses and guided career paths.