Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Finding the Average Price of Items | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
JavaScript Essentials for Beginners - 1768407374405

bookChallenge: Finding the Average Price of Items

Compito

Swipe to start coding

You're working at a local electronics store. Your manager has asked you to calculate the average price of all the items in stock. Instead of doing the math manually, you decide to write a JavaScript program to get the job done quickly!

  • Create a variable totalPrice and set it to 0.
  • Use a for loop to loop through all the elements of prices and add their values to totalPrice.
  • After the loop completes, output the totalPrice divided by the number of items (length of prices array).

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 74
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

bookChallenge: Finding the Average Price of Items

Scorri per mostrare il menu

Compito

Swipe to start coding

You're working at a local electronics store. Your manager has asked you to calculate the average price of all the items in stock. Instead of doing the math manually, you decide to write a JavaScript program to get the job done quickly!

  • Create a variable totalPrice and set it to 0.
  • Use a for loop to loop through all the elements of prices and add their values to totalPrice.
  • After the loop completes, output the totalPrice divided by the number of items (length of prices array).

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 74
single

single

some-alt