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
| defmodule Manager.Costumers.Client do | |
| use Ecto.Schema | |
| import Ecto.Changeset | |
| import Brcpfcnpj.Changeset | |
| alias Manager.Companies.Company | |
| alias Manager.ViaCep.ViaCep | |
| @required ~w(cpf email birthday full_name registration mobile_phone image_url sex state address locality zip_code neighborhood is_active inserted_at updated_at id company_id)a | |
| @optionals ~w(id inserted_at updated_at image_url )a | |
| dbg(@required) |
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
| @impl true | |
| def handle_event("validate", %{"sale_component" => sale_component}, socket) do | |
| changeset = | |
| %Sale{} | |
| |> Sales.change_sale(sale_component) | |
| |> Map.put(:action, :validate) | |
| {:noreply, assign(socket, :form, to_form(changeset) |> dbg())} | |
| end |
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
| defmodule ManagementWeb.SaleLive.SaleFormComponent do | |
| use ManagementWeb, :live_component | |
| alias Management.Sales | |
| alias Management.Sales.Sale | |
| @impl true | |
| def mount(socket) do | |
| changeset = Sales.change_sale(%Sale{}) |
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
| defmodule ManagementWeb.ClientLive.FormComponent do | |
| use ManagementWeb, :live_component | |
| on_mount {ManagementWeb.UserAuth, :ensure_authenticated} | |
| alias Management.Costumers | |
| @options [ | |
| {"Masculino", "masculino"}, | |
| {"Feminino", "feminino"}, | |
| {"Outro", "outro"} |
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
| #Faça um Programa que peça as quatro notas de 10 alunos, calcule e armazene num vetor a média de cada aluno, imprima o número de alunos com média maior ou igual a 7.0. | |
| [1,3.3,True,'Texto'] | |
| vazia = [] | |
| alunos = ['Luis Felipe Rodrigues', 'Bruna Leticia Santos Martins', \ | |
| ' Luana Santos Martins', 'Lourivanda Costa Rodrigues', \ | |
| 'Laura Valentina do Amor', 'Riccardo Trovão', 'Lúcia Martins Santos', 'Felipe Martins','Ivaldo Santos','Fernando Rodrigues'] | |
| alunos [0] | |
| print('A lista ', alunos) | |
| print('Primeira colocado:',alunos[0]) |
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
| import random | |
| n = str(input('Primeiro aluno: ')) | |
| n1 = str(input('Segundo aluno: ')) | |
| n2 = str(input('Terceiro aluno: ')) | |
| n3 = str(input('Quarto aluno: ')) | |
| lista = [n,n1,n2,n3] | |
| random.shuffle(lista) | |
| print(' A ordem de apresentação será ') | |
| print(lista) |
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
| import random | |
| n = input('Digite o primeiro nome: ') | |
| n1 = input('Digite o segundo nome: ') | |
| n2 = input('Digite o terceiro nome: ') | |
| n3 = input('Digite o quarto nome: ') | |
| lista = [n,n1,n2,n3,] | |
| escolhido = random.choice(lista) | |
| print('O escolhido foi {}'.format(escolhido)) |
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
| import pygame | |
| pygame.init() |
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
| casa = float(input('Qual o valor da casa?: R$')) | |
| salario = float(input('Qual é o seu salários?: R$')) | |
| anos = float(input('Em quantos anos você pretende pagar?: ')) | |
| a = anos*12 | |
| s1 = salario*0.30 | |
| parcela = casa/a | |
| if parcela > s1: | |
| print('Empréstimo negado, parcela ultrapassa 30% do seu salário') | |
| else: | |
| print('Parabéns,empréstimo aprovado!') |
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
| a = float(input('Diga o primeiro comprimento: ')) | |
| b = float(input('Diga o segundo comprimento: ')) | |
| c = float(input('Diga o terceiro comprimento: ')) | |
| if a < b+c and b < a+c and c <a+b: | |
| print('Com a soma desses valores é possivel formar um triângulo.') | |
| else: | |
| print('Não é possivel formar um triângulo.') | |
| #DESAFIO 035: |
NewerOlder