Skip to content

Commit

Permalink
aula_08-02-23
Browse files Browse the repository at this point in the history
  • Loading branch information
kauamoreno committed Feb 8, 2023
1 parent e3dae2b commit 2a2ba3d
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aula_08-02-23/conteudo_aula/aula.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var zoo = [
"Leão",
"Girafa",
"Tigre",
"elefante",
"Jacaré"
]

console.log(zoo);
console.log(zoo[1]);


//push() é usado para adicionar um elemento no final do seu array
zoo.push("Cobra");

for(i = 0; i < zoo.length; i++){
console.log(`O animal na jaula ${i + 1} é o ${zoo[i]}`);
}


//zoo.forEach(animal => console.log(`O animal é o ${animal}`))
37 changes: 37 additions & 0 deletions aula_08-02-23/exercicio_1/calc-do_while.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="pt-br">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tabuada</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
background-color: #0d47a1;
color: white;
}
</style>
</head>

<body>

<script>

nTabuada = prompt("Digite um número para a tabuada")
tamanhoTabuada = prompt("Digite o tamanho da tabuada")

var x = 0;
document.body.innerHTML = `<h1>Tabuada do ${nTabuada}</h1>`;
do {
var resultado = nTabuada * (x + 1);
document.body.innerHTML += `${nTabuada} * ${x + 1} = ${resultado} <br>`
x++;
} while (x < tamanhoTabuada);

</script>
</body>

</html>
30 changes: 30 additions & 0 deletions aula_08-02-23/exercicio_1/calc-for.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tabuada</title>
<style>
body{
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
background-color: #0d47a1;
color: white;
}
</style>
</head>
<body>

<script>
nTabuada = prompt("Digite um número para a tabuada")
tamanhoTabuada = prompt("Digite o tamanho da tabuada")

document.body.innerHTML = `<h1>Tabuada do ${nTabuada}</h1>`;
for(x = 0; x < tamanhoTabuada; x++){
resultado = nTabuada * (x+1) ;
document.body.innerHTML += `${nTabuada} * ${x+1} = ${resultado} <br>`
}
</script>
</body>
</html>
36 changes: 36 additions & 0 deletions aula_08-02-23/exercicio_1/calc-while.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="pt-br">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tabuada</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
background-color: #0d47a1;
color: white;
}
</style>
</head>

<body>

<script>

nTabuada = prompt("Digite um número para a tabuada")
tamanhoTabuada = prompt("Digite o tamanho da tabuada")

var x = 0;
while (x < tamanhoTabuada){
var resultado = nTabuada * (x + 1);
document.body.innerHTML += `${nTabuada} * ${x + 1} = ${resultado} <br>`
x++;
}

</script>
</body>

</html>
56 changes: 56 additions & 0 deletions aula_08-02-23/exercicio_2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="pt-br">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jogo de Palavras</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
background-color: #0d47a1;
color: white;
display: flex;
justify-content: center;
}
#filmesDiv{
margin-top: 20px;
}
</style>
</head>

<body>
<main>
<h1>Bem vindo ao jogo dos Filmes!</h1>

<h3>Troque uma palavra do nome dos filmes e veja o que acontece!</h3>

<input type="text" id="palavra" placeholder="Digite uma palavra" /> <br />
<button onclick="muda_palavra()">Jogar</button>

<div id="filmesDiv"></div>
</main>


<script>

function muda_palavra() {
palavra = document.getElementById('palavra').value;

let filmes = [
`A hora do <b>${palavra}</b>`,
`O <b>${palavra}</b> de OZ`,
`11 homens e um <b>${palavra}</b>`,
`<b>${palavra}</b> dos macacos`,
`Procurando <b>${palavra}</b>`
];

document.getElementById("filmesDiv").innerHTML = `${filmes.join('<br>')}`
}

</script>
</body>

</html>

0 comments on commit 2a2ba3d

Please sign in to comment.