generated from reprograma/onX-sx-temaX
-
Notifications
You must be signed in to change notification settings - Fork 40
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
resolução dos exercícios para casa #28
Open
lorenasofia
wants to merge
6
commits into
reprograma:main
Choose a base branch
from
lorenasofia:main
base: main
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
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eaad2e0
exercicioparacasa.py
lorenasofia 6daed29
exercicioparacasa17.py
lorenasofia c95dccd
exercicioparacasa3.py
lorenasofia 2cb9b25
exercicioparacasa17.py
lorenasofia 01652bf
exercicioparacasa.py
lorenasofia a12aa7e
exercicioparacasa3.py
lorenasofia 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,19 @@ | ||
# 16 Faça um programa para uma loja de tintas. O programa deverá pedir o tamanho em metros quadrados da área a ser pintada. Considere que a cobertura da tinta é de 1 litro para cada 3 metros quadrados e que a tinta é vendida em latas de 18 litros, que custam R$ 80,00. Informe ao usuário a quantidades de latas de tinta a serem compradas e o preço total. | ||
|
||
import math | ||
|
||
cobertura_por_litro = 3 # metros quadrados | ||
capacidade_lata = 18 # litros | ||
preco_lata = 80.00 # em reais | ||
|
||
def calcular_tinta(area): | ||
litros_necessarios = area / cobertura_por_litro | ||
latas_necessarias = math.ceil(litros_necessarios / capacidade_lata) | ||
preco_total = latas_necessarias * preco_lata | ||
return latas_necessarias, preco_total | ||
|
||
area_a_pintar = float(input('digite o tamanho em metros quadrados da área a ser pintada: ')) | ||
|
||
latas, preco_total = calcular_tinta(area_a_pintar) | ||
print(f'quantidade de latas necessárias: {latas}') | ||
print(f'preco total: R$ {preco_total:.2f}') |
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,14 @@ | ||
import math | ||
|
||
area = float(input('digite o tamanho em metro quadrado de area a ser pintada: ')) | ||
litros = area/6 | ||
litros_com_folga = litros * 1.1 | ||
|
||
lata = int(litros_com_folga/18) | ||
resto = litros_com_folga % 18 | ||
galoes = math.ceil(resto/3.6) | ||
preco = (lata * 80) + (galoes * 25) | ||
|
||
print(f'misture latas e galoes') | ||
print(f'voce precisa de {lata} latas e galoes {galoes} galoes de tinta') | ||
print(f'o preco total é de R$ {preco:.2f}') |
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,10 @@ | ||
def calcular_soma(a, b, c): | ||
soma = a + b + c | ||
return soma | ||
|
||
num1 = float(input('digite o primeiro número: ')) | ||
num2 = float(input('digite o segundo número: ')) | ||
num3 = float(input('digite o terceiro número: ')) | ||
|
||
resultado = calcular_soma(num1, num2, num3) | ||
print(f'a soma dos três números é: {resultado}') |
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.
Arrasou usando retorno múltilpo na função!