Olamiposi-cloud-coder / developerSkillChallenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temperature Display Challenge

Overview

The Temperature Display Challenge involves creating a function that takes an array of forecasted maximum temperatures as input and logs a formatted string to the console. Each temperature in the array should be displayed with the text "degree C" appended to it, and "and" should be added between each pair of temperatures.

Problem Statement

Given an array of forecasted maximum temperatures, create a function that logs a formatted string to the console.

Function Signature

function displayTemperature(temperatures) { // Function implementation }

Input

temperatures: An array of forecasted maximum temperatures. Each temperature is an integer.

Output

The function should log a string to the console, where each temperature is displayed with the text "degree C" appended to it, and "and" is added between each pair of temperatures.

Example

const temperatures = [17, 21, 33]; displayTemperature(temperatures); // Output: "17 degree C and 21 degree C and 33 degree C"

Installation

No installation is required for this challenge. You can simply copy the provided function displayTemperature and use it in your project.

Usage

Import or include the displayTemperature function in your project. Call the displayTemperature function with an array of forecasted maximum##

About


Languages

Language:HTML 40.4%Language:JavaScript 30.6%Language:CSS 29.1%