Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

// Existem erros de sintaxe neste código - você pode corrigi-lo para passar nos testes?

 

 

function addNumbers(a b c) {

return a + b + c;

}

function introduceMe(name, age)

return "Hello, my name is " + name "and I am " age + "years old";

function getRemainder(a, b) {

remainder = a %% b;

// Use string interpolation here

return "The remainder is %{remainder}"

}

/* ======= TESTS - DO NOT MODIFY ===== */

function test(test_name, expr) {

let status;

if (expr) {

status = "PASSED"

} else {

status = "FAILED"

}

console.log(`${test_name}: ${status}`)

}

test("fixed addNumbers function - case 1", addNumbers(3,4,6) === 13)

test("fixed introduceMe function", introduceMe("Sonjide",27) === "Hello, my name is Sonjide and I am 27 years old")

test("fixed getRemainder function", getRemainder(23,5) === "The remainder is 3")

// A sintaxe para esta função é válida, mas há um erro, localize-o e corrija-o.

 

 

function trimWord(word) {

return wordtrim();

}

function getWordLength(word) {

return "word".length()

}

function multiply(a, b, c) {

a * b * c;

return;

}

/* ======= TESTS - DO NOT MODIFY ===== */

function test(test_name, expr) {

let status;

if (expr) {

status = "PASSED"

} else {

status = "FAILED"

}

console.log(`${test_name}: ${status}`)

}

test("fixed trimWord function", trimWord(" CodeYourFuture ") === "CodeYourFuture")

test("fixed wordLength function", getWordLength("A wild sentence appeared!") === 25)

test("fixed multiply function", multiply(2,3,6) === 36)

#04

welligton costa
Module by welligton costa, updated more than 1 year ago
No tags specified