Skip to content
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
40 changes: 40 additions & 0 deletions exercicios/para-casa/vehicle_home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class Vehicle:
def __init__(self, hallmark, model, age, especification, value_base):
self.hallmark = hallmark
self.model = model
self.age = age
self.especification = especification
self.value_base = value_base

def calculate_taxes(self):
self.value_base = round(self.value_base * 1.1)
return self.value_base

class Car(Vehicle):
def __init__(self, hallmark, model, age, especification, value_base):
super().__init__(hallmark, model, age, especification, value_base)
self.value_base = value_base

def calculate_discount(self):
resume = round(self.value_base * 0.95)
return resume


class Motorcycle(Vehicle):
def __init__(self, hallmark, model, age, especification, value_base):
super().__init__(hallmark, model, age, especification, value_base)
self.value_base = value_base

def calculate_taxes_m(self):
self.value_base = round(self.value_base * 1.05)
return self.value_base

car = Car(f"BMW", "i7 Sedan", 2024, "4 Doors Eletric", 1282950)
print(" BMW Model i7 Sedan 2024 4 Doors Eletric\n",
"Value Base", car.calculate_taxes(),"\n"
" Value to pay", car.calculate_discount(),"\n\n")

motorcycle = Motorcycle(f"BMW", "1250 GS", 2024, "Cylinder 1254", 95990 )
print(" BMW Model 1250 GS 2024 Cylinder 1.254\n",
"Value Base", motorcycle.calculate_taxes(),"\n"
" Value to pay", motorcycle.calculate_taxes_m())
43 changes: 43 additions & 0 deletions exercicios/para-sala/accountbank.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Titular = holder
# Saldo = balance
# Numero da conta = account_number

class AccountBank():
def __init__(self, account_number, holder):
self.account_number = account_number
self.holder = holder
self.balance = 0.0

def deposit(self, value):
if value > 0:
self.balance =+ value
print(f"Deposit value R${value}, Successesfully done.")
else:
print("the deposit amount must be greater than 0 ")

def withdraw(self, value):
if value > 0:
if self.balance >= value:
self.balance -= value
print(f"Withdraw R${value}, Successesfully done")
else:
print("Insufficient balance to withdraw.")
else:
print("The withdrawal amount must be greater than zero")

contaDaviny = AccountBank(202301, "Daviny Letícia")

contaDaviny.deposit(100)

contaDaviny.withdraw(10)

print(contaDaviny.balance)

contaLais = AccountBank(202302, "Lais")

contaLais.deposit(80)

contaLais.withdraw(1000)
# def account_number(self):
# print(f"Account number:\n")

42 changes: 42 additions & 0 deletions exercicios/para-sala/animalperson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# class Animal:
# def __init__(self, name):
# self.name = name

# def makes_sond(self):
# pass

# class Dog(Animal):
# def makes_sound(self):
# return f"{self.name} Makes bark"

# class Cat(Animal):
# def makes_sound(self):
# return f"{self.name} Makes meow"


# dog_Beyoncé = Animal("Yummy")
# dog_Beyoncé = makes_sound("Bark Bark")

class Person:
def __init__(self, nationality, gender, name, age):
self.nationality = nationality
self.gender = gender
self.name = name
self.age = age

def info(self):
print(self.nationality, self.gender, self.name, self.age)

class PersonProfessional(Person):
def __init__(self, nationality, gender, name, age, sector, level):
super().__init__(nationality, gender, name, age)
self.setor = sector
self.level = level

def info(self):
super().info()
print("Sector", self.setor)
print("Level", self.level)

Beyoncé_DB = PersonProfessional("American","Famele", "Beyoncé", "42", "Singer")
Beyoncé_DB.info()
35 changes: 35 additions & 0 deletions exercicios/para-sala/car.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class Vehicle:
def __init__(self, hallmark, type, year):
self.hallmark = hallmark
self.type = type
self.age = year

class Car(Vehicle):
def __init__(self, hallmark, type, year, doors):
super().__init__(hallmark, type, year)
self.hallmark = hallmark
self.type = type
self.age = year
self.doors = doors

def info(self):
print("Hallmark ", self.hallmark, "Type ", self.type, "Year ", self.age + "Doors", self.doors)

class Motorcycle(Vehicle):
def __init__(self, hallmark, type, year, motor):
super().__init__(hallmark, type, year)
self.hallmark = hallmark
self.type = type
self.age = year
self.motor = motor

def info(self):
print("Hallmark ", self.hallmark, "Type ", self.type, "Year ", self.age + "Motor", self.motor)

car = Car("BMW ", "M3 ", "2024 ", "4")
car.info()

motorcycle = Motorcycle("BMW ", "1250 ", "2024 ", "Two-cylinder ")
motorcycle.info()


28 changes: 28 additions & 0 deletions exercicios/para-sala/exercicio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class cachorro:
def init(self, nome, raca): # metodo construtor
self.nome = nome
self.raca = raca

def andar(self):
print('estou andando', self.nome)

def info(self):
print(self.nome, self.raca)

cachorro_lulu = cachorro('lulu', 'Harrier')
cachorro_rex = cachorro('rex', 'Pinscher')

# .... N objetos
cachorro_lulu.info()
cachorro_rex.info()
cachorro_lulu.andar()
print(f'nome do meu cachoro: {cachorro_lulu.nome}')

cachorro_lulu.nome
cachorro_rex.andar()

b = 1
a = 2
print(b.__class__)
resp = b.__add__(a)
print(resp)
36 changes: 36 additions & 0 deletions exercicios/para-sala/extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Immobile:
def __init__(self, address, proprietary_name, value_base):
self.address = address
self.proprietary_name = proprietary_name
self.value_base = value_base

def calculate_rental(self):
return self.value_base

class House(Immobile):
def __init__(self, address, proprietary_name, value_base, area_ground):
super().__init__(address, proprietary_name, value_base)
self.area_ground = area_ground

def calculate_rental(self):
resume = self.value_base + (self.area_ground * 5)
return resume


class Apartment(Immobile):
def __init__(self, address, proprietary_name, value_base, rooms):
super().__init__(address, proprietary_name, value_base)
self.rooms = rooms

def calculate_rental(self):
resume = self.value_base + (self.rooms * 300)
return resume

house_Beyoncé = House("444, Street of glamurously", "Beyoncé", 1500, 300)
apartment_Bruna = Apartment("44, Street of Persistent", "Bruna Bodecam", 1200, 2)

print("Value of rental R$: ", house_Beyoncé.calculate_rental())
print("Value of rental R$: ", apartment_Bruna.calculate_rental())



28 changes: 28 additions & 0 deletions exercicios/para-sala/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Product:
def __init__(self, name, value):
self.name = name
self.value = value

class Vinil(Product):
def __init__(self, name, value, weight):
super().__init__(name, value)
self.name = name
self.value = value
self.weight = weight
def info(self):
print("Name ", self.name, "Value R$ ", self.value + "Weight ", self.weight)

class Digital(Product):
def __init__(self, name, value, megabyte):
super().__init__(name, value)
self.name = name
self.value = value
self.megabyte = megabyte
def info(self):
print("Name ", self.name, "Value R$ ", self.value + "MegaByte", self.megabyte)

renaissancevinil = Vinil("Renaissance ", "400.00 ", " 20")
renaissancevinil.info()

renaissancedigital = Digital("Renaissance ", "150.00 ", "30 ")
renaissancedigital.info()
30 changes: 30 additions & 0 deletions exercicios/para-sala/rectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Largura
# Altura

class Rectangle:
def __init__(self, width, height):
self.width = width
self.height = height

def calculate_area(self):
#print(f"Calculate area{self.width * self.height}")
return self.width * self.height

def calculate_perimeter(self):
return 2 * (self.width + self.height)

house_Beyoncé = Rectangle(5.0, 3.0)
print(f"House of Beyoncé, have:\n {house_Beyoncé.calculate_area()} Area")
print(f"House of Beyoncé have {house_Beyoncé.calculate_perimeter()} Of Perimeter")

house_Bruna = Rectangle(9.0, 10.5)
print(house_Bruna.calculate_area())
print(house_Bruna.calculate_perimeter())


# rectangle = rectangle(5.0, 3.0)
# area = rectangle.calculate_area()
# perimeter = rectangle.calculate_perimeter()

# print(f"Area of Rectangle:\n {area}")
# print(f"Perimeter of Rectangle:\n{perimeter}")