Task 3 Implement the design of the Passenger class so that the following output is produced: The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free. 50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if bag weight is greater than 50 kg. [You are not allowed to change the code below] # Write your code here |Output: Total Passenger: 0 print("Total Passenger:", Passenger.count) p1 = Passenger("Jack") p1.set_bag_weight(90) p2 = Passenger("Carol") Name: Jack Bus Fare: 550 taka Name: Carol Bus Fare: 450 taka p2.set_bag_weight(10) p3 = Passenger("Mike") ===== %3! Name: Mike p3.set_bag_weight(25) Bus Fare: 500 taka == print("=== =") Total Passenger: 3 p1.printDetail() print("= p2.printDetail() print("==== =") p3.printDetail() print("=== print("Total Passenger:", Passenger.count) ======")
Q: Exercise 6 - Loaded Coin Simulation Make a new class in the Lab2 project called LoadedCoinSimthat…
A: Note: Answering in python as no language is mentioned. Input : Head probability Number of…
Q: Write a class that prompts the user for the day’s high and low temperatures. If the high is greater…
A: Step 1:- Note:-I am writing the program in the java language Program Approach:- Import the…
Q: Write a class called Calculation to finish the following tasks of computation. 1. Given an integer…
A: In first program accept input from user so we use scanner class and create one user defined function…
Q: .3.2: Basic class use. Print person1's kids, call the incNumKids() method, and print again,…
A: Java The JavaTM Programming Language is an object-oriented, concurrent, deeply typed,…
Q: Exercise 6 - Loaded Coin Simulation Make a new class in the Lab2 project called LoadedCoinSimthat…
A: class LoadedCoinSim { private String sideUp; /** * Default constructor */…
Q: Implement the design of the Avengers class so that the following output is produced: [You are not…
A: Here I have first of all created the class named Avengers. In this class, I have created a…
Q: Task – 8 Implement the design of the FootBallTeam and the CricketTeam classes that inherit from Team…
A: Please upvote me, I am providing you the correct answer below. Please please I need it badly.…
Q: 11. Implement a class to represent a playing card. Your class should have the following methods:…
A:
Q: Task -6 Given the following classes, write the code for the Triangle and the Trapezoid class so that…
A: Solution :
Q: Task - 4 Given the following classes, write the code for the Book and the CD class so that the…
A: According to the information given:- We have to write a program on the basic of product class , 2…
Q: might not be reasonable to expect users to type long entries such as “oil change” accurately.…
A: import java.util.Scanner; public class CarCareChoice2 { public static void main(String[] args) {…
Q: r this output below. OUTPUT: It's been a good day!. Today, we have already served 66 customers.…
A: Chillox & Customer class for this output below. OUTPUT: It's been a good day!. Today, we have…
Q: Task 4 Implement the design of the Travel class so that the following output is produced: [You are…
A: 1.Creating a class name Travel 2.count is static variable of class because with each time calling…
Q: Use the class provided, TestOverloadCall printMax to print the highest of 33 and 89Call printMax to…
A: Program:public class TestOverload{ public static void main(String[] args) {…
Q: Task - 5 Write the ScienceExam class so that the following code generates the output below: class…
A: class Exam: def __init__(self, marks): self.marks = marks self.time = 60 def…
Q: Write the CheckingAccount class so that the following code generates the output below: class…
A: numberOfAccount is a class level variable which can be accessed by using class name and this gets…
Q: Task - 6 Given the following class, write the code for the Sphere and the Cylinder class so that the…
A: Here I have created the child classes named Sphere and Cylinder. In these classes, I have defined…
Q: Task - 4 Write the Mango and the Jackfruit classes so that the following code generates the output…
A: Here I have defined the child classes Mango and Jackfruit. Inside these classes, I have defined the…
Q: class Duration: def __init__(self, hours, minutes): self.hours = hours…
A: Given:- WHAT IS THE OUTPUT? class Duration: def __init__(self, hours, minutes): self.hours…
Q: Implement the design of the Pizza class so that the following output is produced: # Write your…
A: The Pizza class has four variables to store the data values for the object of the pizza. The three…
Q: Write the CheckingAccount class so that the following code generates the output below: class…
A: ANSWER : Here I have given a python code with the given function name, please find the code, code…
Q: Write a Python Program Implement the design of the Traveller class so that the following output…
A: 1) Below is program that implements the design of the Traveller class so that the following output…
Q: Task - 3 Given the following classes, write the code for the Cricket_Tournament and the…
A: The Answer is
Q: public class BackAccount { public double Balance { set; get; } public void Deposit(double amount) {…
A: Using code snippet above complete the bank account functionality..
Q: Type the program's output class Duration: def _init_(self, hours, minutes): self.hours = hours…
A: Answer: Python Source Code: class Duration: def __init__(self, hours, minutes): self.hours…
Q: 1) Implement the class Image: The height, width and size data fields should be positive. The…
A: Java code import java.util.Date; public class Image { //class with all the variables withdefault…
Q: Type the program's output class Duration: def _init_ (self, hours, minutes): self.hours = hours…
A: class Duration: def __init__(self, hours, minutes): self.hours = hours self.minutes…
Q: Use the class provided, TestOverload Call printMax to print the highest of 33 and 89 Call printMax…
A: Program: public class TestOverload { public static void main(String[] args) {…
Q: Design the Team and Player class so that the following expected output is generated. Your answer…
A: The player class will have constructor which doesn't actually takes positional arguments, but…
Q: class Duration: def __init__(self, hours, minutes): self.hours = hours…
A: Summary: - After checking errors and all making them correct we get the resul
Q: ????????: Implement the design of the ECustomer class so that the following output is produced:…
A: class ECustomer: count = 0 def __init__(self, name): self.name = name…
Q: Question: 2 Implement the design of the Groceries and Buyer classes so that the following code…
A: I have the same implement program which I done few days and it more useful than this
Q: Task - 5 Given the following classes, write the code for the Dog and the Cat class so that the…
A: Answer:- As Given, Step 2 of 3:) Complete Python code: class Animal: def…
Q: Write a program that asks the user to input a sentence and then outputs the sentence back with the…
A: Program: import java.util.Scanner; //for reading input class SentenceCaseReversed{ public static…
Q: def __init__(self, hours, minutes): self.hours = hours self.minutes = minutes…
A:
Q: Write a simple cash register class. (Use Java) Each cash register should keep track of the number…
A: ############################################################## The code for your class is given…
Q: Task - 4 Write the Mango and the Jackfruit classes so that the following code generates the output…
A: Here I have created 2 child classes named Mango and Jackfruit from the parent class Fruit. In these…
Q: Assignment 7A: What's your grade? In this class (as well as the lecture class), we calculate grades…
A: Given that, What’s your grade? In this class (as well as the lecture class), we calculate grades…
Q: Task - 5 Write the ScienceExam class so that the following code generates the output below: class…
A: Solution:- Task 5 Full Code: class E xam: def __init__(self, marks): self.marks = marks self.time =…
Q: Task - 3 Write the CheckingAccount class so that the following code generates the output below:…
A: 1) Below is program that includes CheckingAccount class to generate the output It defines Account…
Q: Create a "tank" class and use it in a program that accepts height and radius from the user and…
A: The class tank will be created using the keyword class. The __init__ function will initialize the…
Q: WAKA, WAKA. Pac-Man was a big hit back in the 80s. One of the things he could do was “teleport” from…
A: A C++ program for the given criteria is as follows, File name: main.cpp” //Declare header files…
Q: Question 9 Implement the design of the Patient class so that the following output is produced: [You…
A: According to the output given:- We have to implement the design of the Patient Class and follow…
Q: Task - 1 Let's Play with Numbers!!! Write the ComplexNumber class so that the following code…
A: 1) Below is python program to include ComplexNumber class to generate the output It defines Real…
Q: Observe the given code carefully. Try to understand from the given code and the outputs what to…
A: Given the code and complete the code with the relevant remaining code. The code contains class…
Q: Home Task: 1. Implement the following class and test its methods: Fraction - numerator: int -…
A: Code In Java:…
Q: Write output for the following code. Which concept is used in the following code class Mango {…
A: Program Approach: Include necessary libraries. Define class Mango. Create a constructor mango with…
Q: 20 Given the above class definition of Color, create a new variable my_color and set it to any shade…
A: OOP or Object-Oriented Programming is a software model that is designed around data or objects…
Q: 4. Write a program that computes the area of a circular region (the shaded area in the diagram)…
A: Answer : CODE IN JAVA: Circle.java file: public class Circle { private double radius; public…
python program
Step by step
Solved in 3 steps with 3 images
- Implement the design of the Patient class so that the following output is produced:[For BMI, the formula is BMI = weight/height^2, where weight is in kg and height inmeters] Driver Code # Write your code herep1 = Patient("A", 55, 63.0, 158.0)p1.printDetails()print("====================")p2 = Patient("B", 53, 61.0, 149.0)p2.printDetails() OutputQuestion: 2 Implement the design of the Laptop and Store classes so that the following code generates the output below: print("Total Laptop Created:",Laptop.total_laptop) print("1.=========================================") s1 = Store() p1 = Laptop("Lenovo B4180", 55000) print("2.=========================================") p2 = Laptop("HP Pavilion") print("3.=========================================") s1.add_laptop(p1, p2) print("4.=========================================") p2.setPrice(77000) s1.add_laptop(p2) print("5.=========================================") s1.sell_laptop("HP Probook") print("6.=========================================") print(s1) print("7.=========================================") s2 = Store("Star Tech") p3 = Laptop("HP Probook", 58000) print("8.=========================================") p4 = Laptop("Lenovo Thinkpad", 60000) print("9.=========================================") p5 = Laptop("HP Elite", 80000)…Implement the design of the Ironman and DoctorStrange class derived from Avengers class so that the following code generates the output below: class Avengers: numberOfAvengers = 0 def __init__(self, name = None): self.name = name print('Welcome to Multiverse!') if self.name == None: print('Who is your favourite Super Hero?') else: print(f'{self.name} is your favourite Super Hero!') def hasSuperPower(self): print('All Avengers have super powers.') def fightThanos(self): return 'No avenger can fight Thanos' #Write your code here #------------------------------------------------------------------------------------- print('1.===============================') print('Number of Avengers:', Avengers.numberOfAvengers) print('2.===============================') a1 = Avengers() print('3.===============================') a1.hasSuperPower() print('4.===============================') print(a1.fightThanos()) print('5.===============================') im1 = Ironman('Tony Stark')…
- ????????: Implement the design of the Pizza class so that the following output is produced: [Your code should work for any number of parameters added in the set_toppings_info method] # Write your codes here. print("Pizza Count:", Pizza.pizza_count) print("=======================") p1 = Pizza("Chicken") p1.set_toppings_info(25, 1, 4, 0) p1.display() print("------------------------------------") p2 = Pizza("Olives") p2.set_toppings_info(15, 1.5, 0, 0) p2.display() print("------------------------------------") p3 = Pizza("Sausage") p3.set_toppings_info(50, 5, 2, 0) p3.display() print("=======================") print("Pizza Count:", Pizza.pizza_count) Output: Pizza Count: 0 ======================= Toppings: Chicken 25 calories 1 g fat 4 g protein 0 g carbs ------------------------------------ Toppings: Olives 15 calories 1.5 g fat 0 g protein 0 g carbs ------------------------------------ Toppings: Sausage 50 calories 5 g fat 2 g protein 0 g carbs ======================= Pizza…Question: 2 Implement the design of the Purchaser and AarongProducts classes so that the following code generates the output below: #Write your code here p1 = Purchaser('Alex Light') print('1.===============================') print(p1) product1 = AarongProducts('Decor', 'Photo-Frame') print('2.===============================') print(product1) print('3.===============================') print(AarongProducts.products) print('4.===============================') AarongProducts.include_products('Souvenirs',['Brass-Flowervase 2170', 'Terracotta-Vase 3500']) print(f'Updated Item List:\n{AarongProducts.products}') print('5.===============================') product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2) print(product2) print('6.===============================') p1.create_invoice(product1, product2) print('7.===============================') product3 = AarongProducts('Decor', 'Candles', 5) print(product3) print('8.===============================') product4 =…Implement the design of the Pizza class so that the following output is produced:[Your code should work for any number of parameters added in the set_toppings_info method]# Write your codes here.print("Pizza Count:", Pizza.pizza_count)print("=======================")p1 = Pizza("Chicken")p1.set_toppings_info(25, 1, 4, 0)p1.display()print("------------------------------------")p2 = Pizza("Olives")p2.set_toppings_info(15, 1.5, 0, 0)p2.display()print("------------------------------------")p3 = Pizza("Sausage")p3.set_toppings_info(50, 5, 2, 0)p3.display()print("=======================")print("Pizza Count:", Pizza.pizza_count)Output:Pizza Count: 0=======================Toppings: Chicken25 calories1 g fat4 g protein0 g carbs------------------------------------Toppings: Olives15 calories1.5 g fat0 g protein0 g carbs------------------------------------Toppings: Sausage50 calories5 g fat2 g protein0 g carbs=======================Pizza Count: 3
- Implement the design of the Student_Tutor class that inherit from Student class so that the following code generates the output below:Hint: Each room has a capacity of 2 Student tutors.class Student: def __init__(self,name,student_id): self.name = name self.student_id = student_id self.semester = "Spring 2022" def details(self): print("Name:",self.name) print("Student_ID:",self.student_id) print("Current Semester:",self.semester)# Write your code here:STs = []S1 = Student("Reem", 18101235)S1.details()print("1.======================================")ST1 = Student_Tutor("Moynul", 16107892, 35, "CSE110", "CSE111")ST2 = Student_Tutor("Priyo", 16107792, 25,"CSE320")ST3 = Student_Tutor("Ronok", 18207892, 36, "CSE110", "CSE111", "CSE221", "CSE220")ST4 = Student_Tutor("Zeba", 19307892, 48, "CSE110")STs.extend([ST1, ST2, ST3, ST4])print("2.======================================")for i in range(len(STs)): STs[i].details()…Question: 2Implement the design of the Chillox and Customer classes so that the following code generates the output below:print(f"It's been a good day!. \nToday, we have already served {Chillox.order_id} customers.")print("**************************************************")outlet1 = Chillox()print("1.==========================================")print("Burger Menu:")print(Chillox.menu)print("2.==========================================")outlet1.addBurger("Chicken Burger",180,"Chicken with Cheese",200)print("3.==========================================")print("Burger Menu:")print(Chillox.menu)print("4.==========================================")c1 = Customer("Samin")c1.order = "2xChicken Burger"outlet1.placeOrderof(c1)print("5.==========================================")outlet1.addBurger('Chicken Smoky BBQ Cheese',225)c2 = Customer("Rafi")c2.setOrder("2xChicken with Cheese,3xChicken Smoky BBQ…Implement the design of the Purchaser and AarongProducts classes so that the following code generates the output below: #Write your code here p1 = Purchaser('Alex Light') print('1.===============================') print(p1) product1 = AarongProducts('Decor', 'Photo-Frame') print('2.===============================') print(product1) print('3.===============================') print(AarongProducts.products) print('4.===============================') AarongProducts.include_products('Souvenirs',['Brass-Flowervase 2170', 'Terracotta-Vase 3500']) print(f'Updated Item List:\n{AarongProducts.products}') print('5.===============================') product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2) print(product2) print('6.===============================') p1.create_invoice(product1, product2) print('7.===============================') product3 = AarongProducts('Decor', 'Candles', 5) print(product3) print('8.===============================') product4 = AarongProducts('Souvenirs', 'Brass…
- Question: 2 write a python program :Implement the design of the Chillox and Customer classes so that the following code generates the output below:print(f"It's been a good day!. \nToday, we have already served {Chillox.order_id} customers.")print("**************************************************")outlet1 = Chillox()print("1.==========================================")print("Burger Menu:")print(Chillox.menu)print("2.==========================================")outlet1.addBurger("Chicken Burger",180,"Chicken with Cheese",200)print("3.==========================================")print("Burger Menu:")print(Chillox.menu)print("4.==========================================")c1 = Customer("Samin")c1.order = "2xChicken Burger"outlet1.placeOrderof(c1)print("5.==========================================")outlet1.addBurger('Chicken Smoky BBQ Cheese',225)c2 = Customer("Rafi")c2.setOrder("2xChicken with Cheese,3xChicken Smoky BBQ…Implement the design of the Laptop and Store classes so that the following code generates the output below:print("Total Laptop Created:",Laptop.total_laptop)print("1.=========================================")s1 = Store()p1 = Laptop("Lenovo B4180", 55000)print("2.=========================================")p2 = Laptop("HP Pavilion")print("3.=========================================")s1.add_laptop(p1, p2)print("4.=========================================")p2.setPrice(77000)s1.add_laptop(p2)print("5.=========================================")s1.sell_laptop("HP Probook")print("6.=========================================")print(s1)print("7.=========================================")s2 = Store("Star Tech")p3 = Laptop("HP Probook", 58000)print("8.=========================================")p4 = Laptop("Lenovo Thinkpad", 60000)print("9.=========================================")p5 = Laptop("HP Elite", 80000)print("10.=========================================")s2.add_laptop(p3, p4,…Answer In python3:Suppose you are an owner of a car wash & service center. Now, implement the design of the Car class so that the following output is produced:[Your code should work for any number of services added in the add_Services method]# Write your code hereprint(“No.of Car=”, Car.count)c1 = Car('Lamborghini', 2002)c1.add_Services('Battery Replacement', 'A/C Recharge')c2 = Car('Toyota Corolla', 2016)c2.add_Services('Radiator Flush', 'Fill Service')c3 = Car('Mitsubishi Pajero', 2018)c3.add_Services('Filter change', 'Timing Belt Replacement')print("=========================")c1.printCarDetail()print("=========================")c2.printCarDetail()print("=========================")c3.printCarDetail()print("=========================")print(“No.of Car =”, Car.count)Output:No.of Car = 0=========================Name: LamborghiniYear of manufacture: 2002List of Services: Battery Replacement , A/C Recharge=========================Name: Toyota CorollaYear of manufacture: 2016List of…