What's the output of the following code? class Person: def __init_(mysillyobject, name, age): mysillyobject.name = name mysillyobject.age = 50 def myfunc(abc): print("Hello my age is", abc.age)
Q: Parent Class: Food Write a parent class called Food. A food is described by a name, the number of…
A: 1. Declare a public class named "Food".2. Define private instance data variables: name (String),…
Q: The parts of the code that need fixing are in the comments. Code is in Python.
A: class TicTacToePlayer: # Player for a game of Tic Tac Toe def __init__(self, symbol, name):…
Q: class City(object): county = "Lake" population = 3000000 def -_init__(self, name, state): self.name…
A: Task : Given the class City in python. The task is to find the set of commands that performs the…
Q: write a class associated with animals atla zoo #Q4 ( # 1) An Animal class that has a name and age…
A: Step 1: Declare class Animal. Define constructor that initializes name and age of animal. Define…
Q: Suppose that these two statements were sequentially appearing within your Rectangle program’s main()…
A: Not valid statementAs we did not create the object for class Rectangle, Just we have created the…
Q: other needed. Your pgm will use the following 20 Krone objects to be created in the exact order in…
A: Implementation of a BSTNode ADT and a BST ADT in Python
Q: Please Fix this probem.
A: We have a given c++ program that prints the points of the rectangle on the display. We need to find…
Q: What will be the resulting value of total after the following code executes? class Measurement {…
A: Explanation: The Measurement class holds one private variable, constructor, copy constructor and…
Q: Take the following code: class Song private: string name; string author; string genre; int…
A: Answer: Code: class Song{ //this is class nameprivate: string name; string author;…
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: Design the Player class so that the code gives the expected output. [You are not allowed to change…
A: Algorithm : Player class : Step 1 : declare default constructor. Step 2 : declare default values…
Q: Area of a rectangle = length * width Create a Class that calculates and prints out the area of a…
A: Note : You have not mention the language of the program so I'm answering your question in C++. Your…
Q: Code:#include <string>using namespace std;class MOVIE {private:string movieTitle;string…
A: The given code for the class “MOVIE” is used in the below program. Keywords should not be used as…
Q: Design a class called “Date". You will have two Date classes – “Date.h" and “Date.cpp". Date will…
A: #include <iostream>#include <string.h>using namespace std;class Date{ private:…
Q: Doggie Day Care Given the TestDog class below, write a Dog class that will pass the tests contained…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: #include #include #include #include using namespace std; class AttackInfo{ public: int dmg; string…
A: Answer: Please try to understand
Q: In a population, the birth rate and death rate are calculated as follows: Birth Rate= Number of…
A: The C++ program using above conditions with snippet of the code.
Q: which one of the following is a data link protocol ... a. all of the mentioned b. ethernet c. HDLC…
A: Answer to the above question is given below
Q: Implement the design of the Student and Lawyer class derived from Person class so that the following…
A: The answer is
Q: Lab 6.2 Download student1.py. Write a script that create 4 students. Each student have 4 random…
A: import random class Student(object): """Represents a student.""" def __init__(self, name,…
Q: Given the following code segment. class Bike { private int wheels; public void setWheel(int wheel) {…
A: Q: Code the given problem in Java
Q: You are writing a program to keep track of a team sport. Write a class, Team.java, that has the…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT-----------------
Q: C++ assigment: It's a Number Guesser assignment. It asks to write a derived class of the…
A: PROGRAM: FILE NAME: “NumberGuesser.h” #ifndef NUMBERGUESSER_H #define NUMBERGUESSER_H #include…
Q: class Employee: def __init__(self, emp_number, emp_last, emp_first, emp_position, emp_department,…
A: Please find the answer below
Q: 1 class Course: 2 B 4 5 7 B B 6 7 8 9 definit__(self): self.roster = [] 2 1 2 B 4 class Student: 5…
A: Class Student defines a Student object, which has the properties first, last, and gpa. Class Course…
Q: For this lab you need to continue editing lab sheet2 , QuadraticEquatio Class: include…
A: C++ language is a direct descendant of C programming language with additional features such as type…
Q: # Pets ## Breed Class Create a `Breed` class with the following: ### Member Variables Create the…
A: Pets Breed Class Create a class with the following: Member Variables Create the following private…
Q: The game of Nim starts with a random number of stones between 15 and 30. Two players alternate turns…
A: The answer is
Q: Operator typeid returns a reference to a(n)__________ object.
A: The typeid keyword is utilized to decide the class of an article at run time. It returns a reference…
Q: Which of the statements are true about the class Magazine? 01: class Magazine { 02: public: 03:…
A: A destructor is a member of a function which is automatically called when the class is destroyed. It…
Q: Please explain the flowchart
A: A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be…
Q: Take the following code: class Song private: string name; string author; string genre; int…
A: Given code is: //setters are used change the value stored in one of an object's member variables…
Q: C++ Create a class named Student that has three member variables: name – A string that stores…
A: Define a class named Student with member variables name, numClasses, and classList. Define a…
Q: Java Programming Please do not change anything in Student class or Course class class John_Smith…
A: Hey there,I am writing the required solution for the above mentioned question below.
Q: In this lab, you create a derived class from a base class, and then use the derived class in a…
A: Requirement- In this lab, you create a derived class from a base class, and then use the derived…
Q: Show the printout of the following code:class A:def _ _init_ _(self, i = 0):self.i = idef…
A: GIVEN: Show the printout of the following code:class A:def _ _init_ _(self, i = 0):self.i = idef…
Q: Create a class named MSUPackage with data fields for course, mode, and insurance package. The mode…
A: The requirement is to solve the given problem in Java language where the below files will be…
Q: Make Album in c++ You are going to develop a new class named Album. This class will has (at a…
A: Program Explanation- Declare the class by the name of the track. Declare the first song. Declare…
Q: Show the output of the following code: (a)class Person:def getInfo(self):return "Person"def…
A: Given: OUTPUT of Python codes.
Q: 52- We have a class named Students which only has double gpa as its private member. You don't need…
A: Your C++ program is given below as you required with an output.
Q: {40 points} Write a program using proper Object Oriented Programming (including good encapsulation)…
A: Student.java public class Student { private String name; private int age; private String…
Q: B. Pet Class Using Python Program, Write a class named Pet, which should have the following data…
A: Q: Code the given class in Python
Q: def __init__(self, hours, minutes): self.hours = hours self.minutes = minutes…
A:
Q: Assignment Details: For this lab you need to continue editing lab sheet2 , QuadraticEquation Class:…
A: A quadratic equation is in the form ax2 + bx + c. The roots of the quadratic equation are given by…
Step by step
Solved in 2 steps
- COSC 1336 – ProgrammingFundamentals I Python Programming Write a class named RetaiI_Item that holds data about an item in a retail store.The class should store the following data in attributes:• Item Number• Item Description• Units in Inventory• PriceCreate another class named Cash_Register that can be used with the Retail_Item class. The Cash_Register class should be able to internally keep a list of Retail_Item objects. The class should include the following methods:• A method named purchase_item that accepts a Retail_Item object as anargument. Each time the purchase_item method is called, the Retail_Itemthat is passed as an argument should be added to the list.• A method named get_total that returns the total price of all theRetail_Items objects stored in the Cash_Register’s internal list.• A method named show_items that displays data about the Retail_Itemobjects stored in the Cash_Register object’s internal list.• A method named clear_items that should clear the…please explain the flowchart:Program - Python This is my program for a horse race class (Problem below code) class Race: def __init__(self,name,time): self.name = name self.time = time self.entries = [] class Entrant: def __init__(self,horsename,jockeyname): self.horsename = horsename self.jockeyname = jockeyname race1 = Race('RACE 1','10:00 AM May 12, 2021')race2 = Race('RACE 2','11:00 AM May 12, 2021')race3 = Race('RACE 3','12:00 PM May 12, 2021') race1.entries.append(Entrant('Misty Spirit','John Valazquez'))race1.entries.append(Entrant('Frankly I’m Kidding','Mike E Smith')) race2.entries.append(Entrant('Rage against the Machine','Russell Baze')) race3.entries.append(Entrant('Secretariat','Bill Shoemaker'))race3.entries.append(Entrant('Man o War','David A Gall'))race3.entries.append(Entrant('Seabiscuit','Angel Cordero Jr')) print(race1.name, race1.time)for entry in race1.entries: print('Horse:',entry.horsename) print('Jockey:',entry.jockeyname) print()…
- #include <iostream>using namespace std; class Date{ string year, month, day, hour, minute; public: Date(int=1990, int=1, int=1, int=12, int=1); Date(const Date &date); //getters: int getYear(); int getMonth(); int getDay(); int getHour(); int getMinute(); //setters: void setYear(int); void setMonth(int); void setDay(int); void setHour(int); void setMinute(int); //toString. string to_string();};class Player{private: string name; int age, goal;public: Player(string nname = "player", int nage = 25, int ngoal = 0); //getter string getname(); int getage(); int getgoal(); //setter void setname(string nname); void setage(int nage); void setgoal(int ngoale); //toString string to_string(); return 0; }; This is an C++ CODE i want your help to let the code run so if you can make itPython: Bank Accountclass Book: book_belongs_to = 'Schulich School of Engineering' def _init_(self, pages = 0, title = 'Unknown', author = 'Unknown', isbn = self.pages = pages self.title = title e): self.author = author self.isbn = isbn book1 = Book(255, 'Black Beauty', 'Anna Sewell', 9780001840423) book2 = Book(208, 'The Chrysalids', 'John Wyndham', 9780140013085) Book.book_belongs_to = 'Emily Marasco' book3 = Book()
- Python Code please Point of Sale Write a program that will manage the point of sale in a store. Build the ItemToPurchase class with the following: Attributes item_name (string) item_price (int) item_quantity (int) Default constructor Initializes item's name = "none", item's price = 0, item's quantity = 0 Method print_item_cost() Example of print_item_cost() output:Bottled Water 10 @ $1 = $10 Extend the ItemToPurchase class to contain a new attribute. item_description (string) - Set to "none" in default constructor Implement the following method for the ItemToPurchase class. print_item_description() - Prints item_description attribute for an ItemToPurchase object. Has an ItemToPurchase parameter. Example of print_item_description() output:Bottled Water: Deer Park, 12 oz. Build the ShoppingCart class with the following data attributes and related methods. Note: Some can be method stubs (empty methods) initially, to be completed in later steps. Parameterized constructor…Question 31 class Person: def __init__(mysillyobject, name, age): = name mysillyobject.name mysillyobject.age = age def myfunc(abc): print("Hello my age is", abc.age) p1 = Person("John", 36) p1.age = 40 p1.myfunc() O 40 Hello my age is 40 36 Hello my age is 36IN C++ Lab #6: Shapes Create a class named Point. private attributes x and y of integer type. Create a class named Shape. private attributes: Point points[6] int howManyPoints; Create a Main Menu: Add a Triangle shape Add a Rectangle shape Add a Pentagon shape Add a Hexagon shape Exit All class functions should be well defined in the scope of this lab. Use operator overloading for the array in Shape class. Once you ask the points of any shape it will display in the terminal the points added.
- Flight assignment runs but there is no imput values for the user to interact when running the program. Kindly fix this issue.import java.util.*; class Flight { String airlineCode; int flightNumber; char type; // D for domestic, I for international String departureAirportCode; String departureGate; char departureDay; int departureTime; String arrivalAirportCode; String arrivalGate; char arrivalDay; int arrivalTime; char status; // S for scheduled, A for arrived, D for departed public Flight(String airlineCode, int flightNumber, char type, String departureAirportCode, String departureGate, char departureDay, int departureTime, String arrivalAirportCode, String arrivalGate, char arrivalDay, int arrivalTime) { this.airlineCode = airlineCode; this.flightNumber = flightNumber; this.type = type; this.departureAirportCode = departureAirportCode; this.departureGate = departureGate;…#Python IDLE: #Below is my Pizza class ,how would I write the function described in the attached image,based on this class? # The Pizza class should have two attributes(data items): class Pizza: # The Pizza class should have the following methods/operators): # __init__ - # constructs a Pizza of a given size (defaults to ‘M’) # and with a given set of toppings (defaults to empty set). def __init__(self, size='M', toppings=set()): self.size = size self.toppings = toppings # setSize – set pizza size to one of ‘S’,’M’or ‘L’ def setSize(self, size): self.size = size # getSize – returns size def getSize(self): return self.size # addTopping – adds a topping to the pizza, no duplicates, i.e., adding ‘pepperoni’ twice only adds it once def addTopping(self, topping): self.toppings.add(topping) # removeTopping – removes a topping from the pizza def removeTopping(self, topping):…java i need just jfram form let you have the book class dont creat it