Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #33

Open
wants to merge 1 commit into
base: aline-santos
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions entrega/exercicio01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
let a = 80000
let b = 200000;

let ano = 0;

do {

a = a + a * 0.03;

b = b + b * 0.015;
ano = ano + 1;

} while (a <= b );

console.log( "Anos: " + ano );
17 changes: 17 additions & 0 deletions entrega/exercicio02.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const readlineSync = require("readline-sync");

function textoInvertido (text) {
let index = 0;
let index2 = 0;
let quantidade = text.length;
let stringReverse = [];
for(index = quantidade - 1, index2 = 0; index >= 0; index--, index2++) {
stringReverse[index2] = text[index];
}
let inverter = stringReverse;
return inverter;

}

let string = readlineSync.question("Esse texto será apresentado invertido");
console.log(textoInvertido(string));
34 changes: 34 additions & 0 deletions entrega/exercicio03.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const readlineSync = require("readline-sync");


function fibonacci(numero) {

let num1 = 0;
let num2 = 1;
let num3 = 0;
let contador = 1;

if(numero == 1 || numero == 2) {
return 1;
}

else {

while(contador <= numero-1) {
num3 = num2 + num1;
num1 = num2;
num2 = num3;

contador++;
}
return num3;



}

}


let numero = parseInt(readlineSync.question("Digite um numero"));
console.log(fibonacci(numero));
26 changes: 26 additions & 0 deletions entrega/exercicio04.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const readlineSync = require("readline-sync");



function funcao (num1, num2, num3) {
return ((numero1*numero2*numero3) + 2);
};

let numero1 = false
let numero2 = false
let numero3 = false

numero1 = readlineSync.question("Digite um numero inteiro: ");
numero2 = readlineSync.question("Digite um numero inteiro: ");
numero3 = readlineSync.question("Digite um numero inteiro: ");

if (numero1 == false || numero2 == false || numero3 == false) {

console.log("Preencha todos os valores corretamente");
numero1 = readlineSync.question("Digite um numero: ");
numero2 = readlineSync.question("Digite um numero: ");
numero3 = readlineSync.question("Digite um numero: ");

}

console.log(funcao(numero1, numero2, numero3));
16 changes: 16 additions & 0 deletions entrega/exercicio05.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const readlineSync = require("readline-sync");


function tabela () {

let x = 1

let valor = 1.99

console.log ("Lojas Quase Dois - Tabelas de preços")

if (x <= 50){
let calculo = x * valor;
console.log(calculo)
}
}