Skip to content
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

Projeto guiado - Steffany Peres #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Diagrama sem nome.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<mxfile host="app.diagrams.net" modified="2024-06-29T12:57:56.371Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" version="24.6.4" etag="8yU3RT2qdnRrIEpZbGvU" type="github">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1223" dy="898" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="Lamp doesn&#39;t work" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="80" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-4" value="Yes" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="WIyWlLk6GJQsqaUBKTNV-10" edge="1">
<mxGeometry y="20" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-5" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="WIyWlLk6GJQsqaUBKTNV-7" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-6" value="Lamp&lt;br&gt;plugged in?" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="170" y="170" width="100" height="80" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-7" value="Plug in lamp" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="320" y="190" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-8" value="No" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" target="WIyWlLk6GJQsqaUBKTNV-11" edge="1">
<mxGeometry x="0.3333" y="20" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-9" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" target="WIyWlLk6GJQsqaUBKTNV-12" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-10" value="Bulb&lt;br&gt;burned out?" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="170" y="290" width="100" height="80" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-11" value="Repair Lamp" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="160" y="430" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-12" value="Replace Bulb" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="320" y="310" width="120" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.
2 changes: 1 addition & 1 deletion exercicios/para-casa/dataset_alunas.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
"Presença": [True, True, True, False, True],
"Participação": 7.5
}
}
}
25 changes: 23 additions & 2 deletions exercicios/para-casa/sistema_de_alunas.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,38 @@ def obter_opcao():

def incluir_nova_aluna():
pass
#TODO - Implentar a função
from dataset_alunas import dataset
nome_completo = input("\nDigite o nome completo da nova aluna: ")
sobrenome = input("Digite o sobrenome da aluna: ")
turma = input("Digite a turma da aluna: ")

Comment on lines +41 to +44
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não está recebendo as notas, lista de presença e nota de participação.




def consultar_lista_alunas():
pass
#TODO - Implentar a função
if dataset :
print("\n Lista de Alunas Cadastradas:")
for idx, aluna in enumerate(dataset ):
print(f"{idx}. {aluna['nome']} {aluna['sobrenome']} - Turma: {aluna['turma']}")
Comment on lines +52 to +53
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementar de forma mais simples ajuda na legibilidade do código. Colocar variáveis com nomes intuitivos ajuda no processo:

Sugestão:

Suggested change
for idx, aluna in enumerate(dataset ):
print(f"{idx}. {aluna['nome']} {aluna['sobrenome']} - Turma: {aluna['turma']}")
for nome, sobrenome in dataset.keys():
print(f'- {nome} {sobrenome}')

else:
print("\n não cadastrada:")


def consultar_faltas_aluna():
nome= input("por favor, nos informe o nome da aluna: ")
sobrenome= input(" agora nos informe o sobrenome da aluna :")

qtd_faltas = dataset[(nome, sobrenome)] ["presença"].count(False)
print((f"A quantidade de faltas de {nome} {sobrenome} são {qtd_faltas[0]}, {qtd_faltas[1]}, {qtd_faltas[2]} "))
Comment on lines +62 to +63
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Este trecho de código apresenta alguns problemas de lógica e formatação que precisam ser corrigidos para funcionar corretamente.

  • A variável qtd_faltas armazena o número total de faltas, e não uma lista.
  • O uso de qtd_faltas[0], qtd_faltas[1], qtd_faltas[2] está incorreto, pois qtd_faltas é um inteiro representando a quantidade total de faltas, e não uma lista.
  • Há excessos de parenteses na linha 63.
    Sugestão:
Suggested change
qtd_faltas = dataset[(nome, sobrenome)] ["presença"].count(False)
print((f"A quantidade de faltas de {nome} {sobrenome} são {qtd_faltas[0]}, {qtd_faltas[1]}, {qtd_faltas[2]} "))
qtd_faltas = dataset[(nome, sobrenome)] ["presença"].count(False)
print(f"A quantidade de faltas de {nome} {sobrenome} são {qtd_faltas} ")

pass
#TODO - Implentar a função

def consultar_notas_aluna():
nome = input("por favor, nos informe o nome da aluna: ")
sobrenome= input(" agora nos informe o sobrenome da aluna :")
valor_notas = dataset[(nome, sobrenome )] ["notas"]
print(f"As três notas de {nome} {sobrenome} é {valor_notas}. ")
Comment on lines +70 to +71
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boa implementação :)

pass
#TODO - Implentar a função

Expand Down