Question: Please program like begginer! copypaste solutions from chat gpt are no welcome . Task 1 . 1 . Define a class Car with attributes make,
Please program like begginer! copypaste solutions from chat gpt are no welcome
Task Define a class Car with attributes make, model, yearofproduction and mileage
Add a method print that will print all the attributes of the car.
Create an object of the class Car with arbitrary attribute values and call the method print.
Add a new method age that will print how old the car is in years, get the current year using the datetime module.
Task Define a class Calculator with attributes a and b Add methods add, subtract, multiply, divide exponent, and root that will perform the corresponding operations on the attributes a and b
Task Definirajte klasu Student s atributima ime, prezime, godine i ocjene.
Iterirajte kroz sljedeu listu studenata i za svakog studenta stvorite objekt klase Student i dodajte ga u novu listu studentiobjekti :
studenti
ime: "Ivan", "prezime": "Ivic", "godise": "ocjene":
ime: "Marko", "prezime": "Markovic", "godine": "ocjene":
fime; "Ana", "preaime"; "Ani "godine"; "ocjene";
ime; "Petra", "prezime"; "Petri "godine": "cojene";
fime: "Iva", "preaime": "Ivie", "godine": "ocjene":
fime: "Mate", "prezime": "Matic", "godine": "ocjese":
l
Dodajte metodu prosjek koja e raunati prosjenu ocjenu studenta.
U varijablu najboljistudent pohranite studenta s najveim prosjekom ocjena iz liste studentiobjekti Implementirajte u jednoj liniji koda.
Task Definirajte klasu Krug s atributom r Dodajte metode opseg i povrsina koje e raunati opseg i povrinu kruga. Stvorite objekt klase Krug s proizvoljnim radijusom i ispiite opseg i povrinu kruga.
Task Define the Worker class with attributes name, position, salary. Add a work method that will print
"I work in the position position
Add a Manager class that inherits from the Worker class and define the department attribute for it Add method work which will print "I work in the position position in the department department
Add a giveraise method to the Manager class that receives the parameters worker and raise i
increases the salary of the worker Worker by the amount of the increase.
Define one instance of the Worker class and one instance of the Manager class and call the work i methods
give raise.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
