-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ucam-campos/Andre
Adiciona Resoluções de Andre do Capítulo 6
- Loading branch information
Showing
5 changed files
with
62 additions
and
0 deletions.
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,8 @@ | ||
puts "Informe sua nota:" | ||
nota = gets.to_f | ||
|
||
if nota >= 6 | ||
puts "Você foi aprovado!" | ||
else | ||
puts 'Você foi reprovado!' | ||
end |
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,8 @@ | ||
puts "Informe sua nota:" | ||
nota = gets.to_f | ||
|
||
if nota >= 6 | ||
puts "Você foi aprovado!" | ||
else | ||
puts 'Você foi reprovado!' | ||
end |
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,9 @@ | ||
puts "Informe sua idade:" | ||
def validar (idade) | ||
if idade < 18 | ||
return "Você é menor de idade" | ||
else | ||
return "Você é maior de idade" | ||
end | ||
end | ||
puts validar(gets.to_i) |
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 @@ | ||
puts "Informe um numero:" | ||
num = gets.to_i | ||
def par_impa (valor) | ||
if valor%2 == 0 | ||
return "par" | ||
end | ||
|
||
return "impa" | ||
end | ||
|
||
puts "O numero #{num} é #{par_impa(num)}" |
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,26 @@ | ||
begin | ||
puts "Digite 1 - Projeto ou 2 - Auditoria" | ||
tipo = gets.to_i | ||
end while (tipo != 1) && (tipo != 2) | ||
|
||
|
||
if tipo == 1 | ||
dia = 200.0 | ||
viagem = 1000.0 | ||
tipo_desc = "Projeto" | ||
else | ||
dia = 100.0 | ||
viagem = 1500.0 | ||
tipo_desc = "Auditoria" | ||
end | ||
|
||
|
||
puts "Informe o num de dias:" | ||
vl_dias = gets.to_f * dia | ||
|
||
puts "Informe o num de viagem:" | ||
vl_viagem = gets.to_f * viagem | ||
|
||
|
||
puts "O orcamento para #{tipo_desc}, valor dias #{vl_dias} valor viagem #{vl_viagem}:" | ||
puts "R$%.2f"% (vl_dias + vl_viagem) |