Overview

Introduction

Welcome to the Creating the Calculator Application Practice Lab. In this module you will be provided with the instructions and devices needed to develop your hands-on skills.

Exam Objectives

The following exam objectives are covered in this lab:

  • 2.5 Complete and debug a function that accepts parameters and returns a value
  • 4.2 Identify and handle HTML events

Lab Duration

It will take approximately 20 minutes to complete this lab.

Exercise 1 - Creating the Calculator Application

A calculator takes the inputs from the user and helps to perform arithmetic and mathematical calculations. Using HTML and CSS, you can design a professional interface of a calculator. The numbers and the operators are displayed as buttons. You need to click the required buttons and the result is displayed. Events are triggered when the buttons are clicked. The event handlers invoke the user-defined functions written in JavaScript.

In this exercise, you will learn how to create a simple calculator application in JavaScript. You will perform two tasks:

  • Task 1 - You will download the Visual Studio Code workspace (Calculator) from the Intranet and create a new HTML page named Calc.html in the Calculator workspace.
  • Task 2 - You will write JavaScript code to create a simple calculator application using events and user-defined functions.

Learning Outcomes

After completing this exercise, you will be able to:

  • Create a simple calculator application in JavaScript

Comprehensive Learning

See the full benefits of our immersive learning experience with interactive courses and guided career paths.