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

/ **

Vamos olhar para o futuro usando uma Magic 8 Ball!

https://en.wikipedia.org/wiki/Magic_8-Ball

Existem algumas etapas para poder visualizar o futuro:

* Faça uma pergunta

* Agite a bola

* Obter uma resposta

* Decida se é positivo ou negativo

A pergunta pode ser qualquer coisa, mas as respostas são fixas,

e têm diferentes níveis de positividade ou negatividade.

Abaixo estão as respostas possíveis:

## Muito positivo

É certo.

É decididamente assim.

Sem dúvida.

Sim definitivamente.

Você pode contar com ele.

## Positivo

A meu ver, sim.

Provavelmente.

Outlook bom.

Sim.

Sinais apontam que sim.

## Negativo

Resposta nebulosa, tente novamente.

Pergunte novamente mais tarde.

Melhor não te dizer agora.

Não posso prever agora.

Concentre-se e pergunte novamente.

## Muito negativo

Não conte com isso.

Minha resposta é não.

Minhas fontes dizem não.

Outlook não é tão bom.

Muito duvidoso.

* /

// Isso deve registrar "A bola tremeu!"

// e retorna a resposta.

 

 

function shakeBall() {}

// A resposta deve vir sacudindo a bola

let answer;

// Ao verificar a resposta, devemos dizer a alguém se a resposta é

// - muito positivo

// - positivo

// - negativo

// - muito negativo

function checkAnswer() {}

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

const log = console.log;

let logged;

console.log = function() {

log(...arguments);

logged = arguments[0];

};

function test(test_name, expr) {

let status;

if (expr) {

status = "PASSED";

} else {

status = "FAILED";

}

logged = undefined;

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

}

const validAnswers = [];

function testAll() {

const answer = shakeBall();

test(

`shakeBall logs "The ball has shaken!"`,

logged === "The ball has shaken!"

);

test(`shakeBall returns an string answer"`, typeof answer === "string");

test(

`checkAnswer returns the level of positivity"`,

["very positive", "positive", "negative", "very negative"].includes(

checkAnswer(answer)

)

);

}

testAll();

  

/ *

LITERAIS BOOLEANOS

----------------

Este programa precisa de algumas variáveis ​​para registrar o resultado esperado.

Adicione as variáveis ​​necessárias com os valores booleanos corretos atribuídos.

* /

var codeYourFutureIsGreat = true;

/*

DO NOT EDIT BELOW THIS LINE

--------------------------- */

console.log("Is Code Your Future great?", codeYourFutureIsGreat);

console.log("Is Mozafar cool?", mozafarIsCool);

console.log("Does 1 + 1 = 2?", calculationCorrect);

console.log("Are there more than 10 students?", moreThan10Students);----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

/ *

RESULTADO ESPERADO

---------------

Codifique seu futuro é ótimo? verdade

Mozafar é legal? falso

1 + 1 = 2? verdade

Existem mais de 10 alunos? falso

* /

#08

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