-
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
Enviando exercícios obrigatórios e extras de Rebeca Coelho. #25
base: rebeca-coelho
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var celsius = Number (prompt("Digite a temperatura em Celsius: ")) | ||
var calculoFahrenheit = celsius * 9 / 5 + 32 | ||
var fahrenheit = celsius + calculoFahrenheit | ||
|
||
console.log ("A temperatura em celsius para fahrenheit é: " + fahrenheit) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var fahrenheit = Number (prompt("Digite a temperatura em fahrenheit: ")) | ||
var calculoCelsius = fahrenheit / 9 / 5 + 32 | ||
var celsius = celsius + calculoFahrenheit | ||
|
||
console.log ("A temperatura em fahrenheit para celsius é: " + celsius) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var peixePeso = Number (prompt("Digite a quantidade em quilos dos peixes:" )) | ||
var excesso = (peixePeso > 50 kg) | ||
var multa = 4 reais | ||
|
||
if (pesoPeixe > 50 kg) { | ||
|
||
console.log ( "O peso dos peixes é maior que 50 kg. E pagará multa de 4 reais por quilo excedente." ) | ||
|
||
} else (pesoPeixe =< 50 kg) { | ||
console.log ( "O peso dos peixes é igual ou inferior aos 50 kg. Não pagará multa." ) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var quantidadeKm = Number (prompt ("Digite a quantidade de kilometros andados pelo carro:" )) | ||
var quantidadeDiasAlugados = Number (prompt ("Digite a quantidade de dias em que o carro foi alugado:" )) | ||
var aluguelCarroDia = 60 | ||
var valorKmRodado = 0.15 | ||
var precoPagar = quantidadeDiasAlugados * 60 + quantidadeKm * 0.15 | ||
|
||
console.log (O preço a pagar pelo carro alugado é o valor de: " + precoPagar) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var ladoA = Number (prompt ( "Digite o valor do lado A do triângulo:" )) | ||
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. Aqui é legal vc deixar colado, sem espaços. Exemplo: var ladoA = Number(prompt("Digite o valor do lado A do triângulo:" )) |
||
var ladoB = Number (prompt ( "Digite o valor do lado B do triângulo: ")) | ||
var ladoC = Number (prompt ( "Digite o valor da base do triângulo: ")) | ||
|
||
if (ladoA == ladoB == ladoC) { | ||
console.log ("Os lados formam triângulo equilátero.") | ||
} else if ( ladoB != ladoA != ladoC) { | ||
console.log ("Os lados formam triângulo escaleno.") | ||
} else (ladoC > ladoA == ladoB) { | ||
console.log ("Os lados formam um triângulo isósceles.") | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var nota1 = Number (prompt("Digite a primeira nota: ")) | ||
var nota2 = Number (prompt("Digite a segunda nota: ")) | ||
var nota3 = Number (prompt("Digite a terceira nota: ")) | ||
var nota4 = Number (prompt("Digite a quarta nota:" )) | ||
var nota5 = Number (prompt("Digite a quinta nota:" )) | ||
var mediaAprovada = 7 | ||
var mediaReprovada = 5 | ||
var mediaRecuperacao = >= 5 & < 7 | ||
var media = nota1 + nota2 + nota3 + nota4 + nota5 / 5 | ||
|
||
if (nota1 + nota2 + nota3 + nota4 + nota5 / 5 >= mediaAprovada) { | ||
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. que tal aqui vc olhar pra variavel |
||
console.log ("A aluna foi aprovada com média maior ou igual a 7.") | ||
|
||
} else if (nota1 + nota2 + nota3 + nota4 + nota5 / 5 < mediaReprovada) { | ||
console.log ("A aluna está reprovada com média menor que 5.") | ||
|
||
} else (nota1 + nota2 + nota3 + nota4 + nota5 / 5 = mediaRecuperacao) { | ||
console.log ("A aluna está em recuperação.") | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var quantidadeCigarrosDia = Number (prompt ("Digite a quantidade de cigarros fumados por dia: ")) | ||
var quantidadeAnos = Number (prompt("Digite a quantidade de anos fumados: ")) | ||
var minutosPorCigarro = 10 | ||
var diasAno = 360 | ||
var diasPerdidosFumante = quantidadeCigarrosDia * minutosPorCigarro * quantidadeAnos * diasAno | ||
|
||
if (quantidadeCigarrosDia * minutosPorCigarro * quantidadeAnos * diasAno = diasPerdidosFumante){ | ||
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. Fiquei em duvida: pq vc usou um |
||
console.log (O total de dias perdidos ao fumante será de:") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var ano = Number (prompt ("Digite o ano: ")) | ||
var bissexto = 366 | ||
|
||
if (ano / 4 = bissexto) { | ||
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. Aqui vc está assumindo que se dividirmos um numero 4 ele vai ser igual 366. Temos outras regras para validar se um ano é bissexto ou não, lembra?
Todos os outros que não estão nessa regra, não são bissextos ;) |
||
console.log ("O ano é bissexto"); | ||
} | ||
else (ano / 4 != bissexto) { | ||
console.log ("O ano não é bissexto."); | ||
} |
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.
Aqui seria interessante calcular qual o valor da multa que João pagará.