generated from reprograma/onX-sx-temaX
-
Notifications
You must be signed in to change notification settings - Fork 40
Igea Martins - Semana 2 #32
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
Open
igeam
wants to merge
2
commits into
reprograma:main
Choose a base branch
from
igeam: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
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 calculaSoma(x,y,z): | ||
| soma = x + y + z | ||
| return soma | ||
|
|
||
| argumento1 = 12 | ||
| argumento2 = 3 * argumento1 | ||
| argumento3 = 2 * argumento2 | ||
|
|
||
| resultado = calculaSoma(argumento3, argumento2, argumento1) | ||
| print(resultado) |
This file contains hidden or 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,13 @@ | ||
| print("Olá! Gostaria de calcular a quantidade de latas de tinta e o valor total? Você veio ao lugar certo!") | ||
|
|
||
| metragem = float(input("Insira a área a ser pintada em metros quadrados aqui: ")) | ||
| litragem = metragem / 3 | ||
| qLatas = litragem / 18 | ||
| qLatasD = (litragem//18)+1 | ||
| vT = qLatas * 80 | ||
| vTD = (qLatasD)*80 | ||
|
|
||
| if (metragem%54 == 0 and litragem//18 >=1): | ||
| print("A quantidade de latas necessária é", qLatas, ". O valor da compra será de R$", vT) | ||
| else: | ||
| print("A quantidade de latas necessária é", qLatasD, ". O valor da compra será de R$", vTD) |
This file contains hidden or 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,29 @@ | ||
| print("Olá! Gostaria de calcular a quantidade de latas de tinta e o valor total? Você veio ao lugar certo!") | ||
|
|
||
| metragem = float(input("Insira a área a ser pintada em metros quadrados aqui: ")) | ||
| litragem = int((metragem + 0.1 * metragem)/6+1) | ||
|
|
||
| #if | ||
| qLatas = int((litragem/18)+1) | ||
| vTL = qLatas * 80 | ||
|
|
||
| #elif1 | ||
| qGaloes = int((litragem/3.6)+1) | ||
| vTG = qGaloes * 25 | ||
|
|
||
| #elif3 | ||
| qLatas2 = #dúvida mortal | ||
| qGaloes2 = #dúvida mortal | ||
| vTLG = (qLatas2 * 80) + (qGaloes2 * 25) | ||
|
|
||
| if (metragem % 97.2 == 0): | ||
|
Collaborator
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 é errado usar 97.2, mas imagine em você mesma daqui dois meses olhando esse código. O que significa 97.2? |
||
| print("Você vai precisar de", qLatas, "latas e o valor da compra será de R$", vTL) | ||
| elif (metragem % 19.44 == 0): | ||
| print("Você vai precisar de", (qGaloes), "galões e o valor da compra será de R$", vTG) | ||
| elif (metragem <= 19.44): | ||
| print("Você vai precisar de 1 galão e o valor da compra será de R$ 25.0") | ||
| elif (litragem - (qLatas2 * 18) % 3.6 != 0): | ||
| #dúvida mortal | ||
| print("Vamos economizar! Você precisa de", qLatas2, "latas e", qGaloes2, "galoes, vai custar R$" (vTLG)".") | ||
| else: | ||
| print("erro") | ||
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.
A quantidade de latas é calculada igual no primeiro exercício, mas sem usar o arredondamento pra cima.
E o cálculo de galões é feito com o resto de tinta que faltou em latas, arredondado pra cima, pra garantir que não vai faltar.
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.
obrigada Belisa! entendi agora que é mais simples do que a forma como eu queria fazer. Já tó aplicando isso nos exercícios de Estrutura de Decisão :)