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
exercicios semana2 - Júlia Brêtas #26
Open
juliabretas
wants to merge
1
commit into
reprograma:main
Choose a base branch
from
juliabretas: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
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,28 @@ | ||
#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 | ||
|
||
print("Digite a area a ser pintada: ") | ||
m2_area = float(input()) | ||
|
||
litros = m2_area / 3 | ||
tamanho_lata = 18 | ||
valor_lata = 80 | ||
|
||
|
||
print ("Area a ser pintada em m2: ", m2_area) | ||
|
||
litros_totais = m2_area / litros | ||
|
||
qtd_latas = math.ceil(litros / tamanho_lata) | ||
print ("Quantidade de latas a serem compradas: ", qtd_latas) | ||
|
||
preco_total = qtd_latas * valor_lata | ||
print("Valor total da compra: ", preco_total) | ||
|
||
|
||
|
||
|
||
|
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,36 @@ | ||
#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 6 metros quadrados e que | ||
# a tinta é vendida em latas de 18 litros, que custam R$ 80,00 ou | ||
# # em galões de 3,6 litros, que custam R$ 25,00. | ||
# Informe ao usuário as quantidades de tinta a serem compradas e os respectivos preços em 3 situações: | ||
#comprar apenas latas de 18 litros; | ||
#comprar apenas galões de 3,6 litros; | ||
#misturar latas e galões, de forma que o desperdício de tinta seja menor. | ||
# Acrescente 10% de folga e sempre arredonde os valores para cima, isto é, considere latas cheias. | ||
|
||
import math | ||
|
||
#tamanho em metro quadrado da área | ||
area = float(input()) | ||
print("Tamanho da area em m2: ", area) | ||
|
||
litro = 6 | ||
tamanho_lata = 18 | ||
valor_lata = 80 | ||
tamanho_galao = 3.6 | ||
valor_galao = 25 | ||
|
||
|
||
litros_totais= area / litro | ||
|
||
litros_com_folga = litros_totais * 1.1 | ||
latas = int(litros_com_folga / tamanho_lata) | ||
resto = litros_com_folga % tamanho_lata | ||
galoes = math.ceil(resto/tamanho_galao ) | ||
|
||
preco = (latas * 80) + (galoes * 25) | ||
|
||
print("Serao necessarios ", latas, "latas e ", galoes, "galoes de tinta") | ||
print("O valor total da compra é ", preco) | ||
|
||
|
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,15 @@ | ||
#Faça um programa, com uma função que necessite de três argumentos, | ||
#e que forneça a soma desses três argumentos. | ||
|
||
def sacolao(laranja, pera, pessego): | ||
total_frutas = (laranja + pera + pessego) | ||
return total_frutas | ||
|
||
laranja = 3 | ||
pera = 5 | ||
pessego = 2 | ||
|
||
total_frutas = sacolao(laranja, pera, pessego) | ||
print("Unidades de frutas compradas: ", total_frutas) | ||
|
||
|
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.
Não é errado usar 80 (o preço da lata), mas imagine em você mesma daqui dois meses olhando esse código. O que significa 80?