-
Notifications
You must be signed in to change notification settings - Fork 34
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
adicionando os exercicios de 1 ao 8 - Mariana Franca #28
Open
mariana-franca
wants to merge
1
commit into
reprograma:mariana-franca
Choose a base branch
from
mariana-franca:mariana-franca
base: mariana-franca
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let valorCelsius = Number(prompt("Digite o valor da temperatura em Celsius")); | ||
let conversãoFahrenheit = 9*valorCelsius/5 + 32 | ||
|
||
console.log ("O valor em Fahrenheit é: "+ conversãoFahrenheit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let valorFahrenheit = Number(prompt("Digite o valor da temperatura em Fahrenheit")); | ||
let conversãoCelsius = ((valorFahrenheit-32) * 5/9) | ||
|
||
console.log ("O valor em Celsius é: "+ conversãoCelsius); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let kiloPeixe = Number (prompt("Digite o kilo do peixe ")); | ||
let excesso = kiloPeixe - 50 | ||
let multa = excesso*4 | ||
|
||
if (kiloPeixe >50){ | ||
|
||
console.log ("Houve", excesso ,"kg de excesso de peso") | ||
console.log ("Multa de R$", multa) | ||
|
||
} | ||
|
||
else if (kiloPeixe <= 50) { | ||
|
||
console.log ("Houve", excesso-excesso ,"de excesso peso") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Não entendi bem o que vc quis fazer com |
||
console.log ("Multa de R$", multa-multa) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let kmPecorridos = Number(prompt("Você pecorreu quantos kilometros?")); | ||
let diaAlugados = Number(prompt("Você alugou o carro por quantos dias?")); | ||
|
||
let valorPagamento = ((kmPecorridos * 0.15) + (diaAlugados * 60)); | ||
console.log ("Preço a pagar R$", valorPagamento ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
let ladoA = Number(prompt("Digite um valor do lado A do triângulo")) | ||
let ladoB = Number(prompt("Digite o valor do lado B do triângulo")) | ||
let ladoC = Number(prompt("Digite o valor do lado C do triângulo")) | ||
|
||
|
||
if (ladoA <= 0 || ladoB <= 0 || ladoC <= 0) { | ||
alert ("Erro, esse valor não é aceito, por favor digite novamente"); | ||
} | ||
|
||
if ((ladoA<ladoB+ladoC) && (ladoB<ladoA+ladoC) &&(ladoC<ladoA+ladoB)){ | ||
if ((ladoA==ladoB) && (ladoB==ladoC)) | ||
console.log ("Esse é um triângulo equilátero") | ||
else if ((ladoA==ladoB || ladoA==ladoC || ladoC==ladoB)) | ||
console.log ("Esse é um triângulo isóceles") | ||
else if ((ladoA!=ladoB) && (ladoA!=ladoC)) | ||
console.log ("Esse é um triângulo escaleno") | ||
} | ||
|
||
|
||
else { | ||
console.log ("Isso não é um triângulo") | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let nota1 = Number(prompt("Digite sua primeira nota")) | ||
let nota2 = Number(prompt("Digite sua segunda nota")) | ||
let nota3 = Number(prompt("Digite sua terceira nota")) | ||
let nota4 = Number(prompt("Digite sua quarta nota")) | ||
let nota5 = Number(prompt("Digite sua quinta nota")) | ||
|
||
let notaMedia = ((nota1 + nota2 + nota3 + nota4 + nota5) /5) | ||
console.log ("Sua media foi" , notaMedia ) | ||
|
||
if (notaMedia >= 7){ | ||
console.log ("Você foi aprovado") | ||
} | ||
|
||
else if (notaMedia < 5){ | ||
console.log ("Você foi reprovado") | ||
|
||
} | ||
else{ | ||
console.log ("Você está em recuperação") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let cigarrosDia = Number(prompt("Quantos cigarros você fuma por dia?")) | ||
let tempo = Number(prompt("Há quantos anos você fuma?")) | ||
|
||
let tempoTotal = (tempo * 365); | ||
let cigarroTotal= (cigarrosDia * tempoTotal); | ||
|
||
let tempoPerdido = ((cigarroTotal * 10) / 1440).toFixed (); | ||
|
||
console.log | ||
("Você furmou até agora na vida inteira um total de", cigarroTotal, "cigarros e por isso já perdeu", tempoPerdido, "dias de vida"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let ano = Number(prompt("Digite o ano desejado")) | ||
|
||
if ((ano % 4 == 0) && (ano%100 !=0) || (ano % 400==0)){ | ||
console.log ("É um ano bissexto") | ||
} | ||
|
||
else { | ||
console.log ("Não é um ano bissexto") } | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nesse caso, se vc colocar somente um
else
ele ja vai entrar mesmo assim pq la no if vc condicionou que a multa só será cobrada de valores maiores do que 50. Faz sentido?