/ *
Operadores lógicos
---------------------------------
Este programa chama algumas funções que estão ausentes ou incompletas.
Atualize o código para obter o resultado esperado.
* /
function isNegative() {}
/*
DO NOT EDIT BELOW THIS LINE
--------------------------- */
console.log("Is -10 is a negative number?", isNegative(-10));
console.log("Is 5 a negative number?", isNegative(5));
console.log("Is 10 in the range 5-10?", isBetween5and10(10));
console.log("Is Daniel a short name?", isShortName("Daniel"));
console.log("Does Daniel start with 'D'?", startsWithD("Daniel"));
/ *
RESULTADO ESPERADO
---------------
-10 é um número negativo? verdade
5 é um número negativo? falso
10 está no intervalo de 5 a 10? verdade
Daniel é um nome curto? verdade
Daniel começa com 'D'?
* /
/ *
Condicionais
---------------------------------
Escreva uma função para testar se um número fornecido é negativo ou positivo
- se o número for menor que zero, retorna a palavra "negativo"
- se o número for maior ou igual a zero, retorna a palavra "positivo"
* /
function negativeOrPositive(number) {
}
/*
DO NOT EDIT BELOW THIS LINE
--------------------------- */
var number1 = 5;
var number2 = -1;
var number3 = 0;
console.log(number1 + " is " + negativeOrPositive(number1));
console.log(number2 + " is " + negativeOrPositive(number2));
console.log(number3 + " is " + negativeOrPositive(number3));
/ *
RESULTADO ESPERADO
---------------
5 é positivo
-1 é negativo
0 é positivo
* /