Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Declaring & Using Constants | Manipulating Data
Introduction to JavaScript

bookChallenge: Declaring & Using Constants

Task

Swipe to start coding

You're building a subscription management system for a new streaming service. The program calculates the total subscription cost based on:

  • The number of devices a user has.
  • A fixed monthly price.

Your task: Declare a constant called MONTHLY_PRICE and assign it the value 9.99. The constant should then be used to calculate the total subscription cost.

Note

In most programming languages, constants are typically written in all uppercase letters, with words separated by underscores (_). This naming convention helps differentiate constants from regular variables and makes them easier to recognize in code.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 7
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Declaring & Using Constants

Swipe to show menu

Task

Swipe to start coding

You're building a subscription management system for a new streaming service. The program calculates the total subscription cost based on:

  • The number of devices a user has.
  • A fixed monthly price.

Your task: Declare a constant called MONTHLY_PRICE and assign it the value 9.99. The constant should then be used to calculate the total subscription cost.

Note

In most programming languages, constants are typically written in all uppercase letters, with words separated by underscores (_). This naming convention helps differentiate constants from regular variables and makes them easier to recognize in code.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 7
single

single

some-alt