What is the output of the following code? class Person: def __init__(mysillyobject, name, age): mysillyobject.name = name mysillyobject.age = age def myfunc(abc): print("Hello my name is abc.name") p1 = Person("John", 36) p1.myfunc()
Q: For the next set of questions, consider the following graph Gr= (V,E). D 6 5 2 B 2 6 F 7 3 2 1 8 G
A:
Q: (i) What is the probability that three pairwise distinct elements u₁, U2, U3 € U are mapped by the…
A: The main logic behind this is that if x is replaced by x+y, where y is the largest element in the…
Q: Please comment all code Using a python editor, write a python script that imports os and does the…
A: Python script It change to the path created previously It display current directory It check if the…
Q: The question is how many address bits are required for 1024K words.
A: A software programme called a database management system (DBMS) is used to store and retrieve user…
Q: 1. Delete MOROCCO. After deleting this node, which node has an imbalance? 2. After the first…
A: When Morocco is deleted, it's parent Poland will have 2 nodes at right side and 0 nodes at left…
Q: Python Programming Language
A: Answers to given blanks will be following : vehicles 'citympg' 'count' 'mean' 'std'
Q: Disjoint Sets are a data structure for keeping track of associations among items in a larger system.…
A: Answer: We need to write about the how the perform the instruction by the disjoint set and in this…
Q: Convert the following program to use OpenMP. Specifically, you must use OpenMP "parallel for". int…
A: Dear Student, The converted code using OpenMP is given below -
Q: Provide a brief description of the core features found in most operating systems
A: INTRODUCTION: An operating system (OS) is a software interface that connects a computer user to…
Q: C++ (C plusplus) Requirements: Use the given class “User” (below) All data members must be…
A: Define a new exception class named “BadValueException” class BadValueException : public…
Q: Suppose you have a RISC machine with a 2.7 GHz clock (i.e., the clock ticks 2.7 billion times per…
A: Given, Clock frequency = 2.7 GHz Time = 4.4 ms The instructions SET, LOAD, ADD, and LOOP have the…
Q: Processes outside of systems analysis may be described using structured English.
A: The term "structured programming approaches" refers to all of the methods that are defined by…
Q: What is (1.0111 * 2 ^ 5)(1.101 * 2 ^ 3)
A: Note that there were no extra information provided hence assuming this number belongs to IEEE 754…
Q: Consider the following code: int main (void) ( std::vector intVector(0); } intVector.pushback(1);…
A: Vectors are the same as the dynamic array. In vectors, storage is managed automatically by itself.…
Q: Exactly what makes the Internet such a shining example of ICT? The arguments and examples you…
A: Why is the internet among the best examples of ICT? Each point should be backed up with specific…
Q: Please describe the following as a bare minimum of what should be included in a distributed database…
A: Instead of having only one logical database, it is really feasible to have a distributed database…
Q: he that the adjacency list of each node is sorted alphabetic cerm parent in the question is…
A: Lets see the solution.
Q: Simple try-catch Program This lab is a simple program that demonstrates how try-catch works. You…
A: Solution: Java Code: TryCatchExampleSimple.java import java.util.Scanner;public class…
Q: 1. Consider the following program the execution times of its instructions. for (1-0, z=0; i3)…
A: Time complexity is defined as the amount of the time taken by an algorithm to run, as the function…
Q: Question 41 What is the output of the following? import mymodule as mm a = mm.person1["name"]…
A: 1) Program in question has two parts mymodule.py It defines a function greeting which takes a…
Q: Write an inline assembly program that reads a string (myStr) and prints a new list with unique…
A: The code is written in C with inline assembly. The program reads a string (myStr) from the user and…
Q: 6. The following wff is quantificationally true, prove it: [(Vx)Dx V (Vx)Ex] → (Vx) (Dx V Ex)
A: Proof: Let X be an arbitrary domain . Given: [(VX)Dx V (Vx)Ex] To prove: (Vx)(DxV Ex) Proof by…
Q: 3. Use the Jacobi Method, Gauss Seidel Method to solve the sparse system within six correct decimal…
A: Here is the matlab code of the above problem. See below steps.
Q: What kind of safety measures apply, for instance, during vehicle-to-vehicle transfers?
A: Transfers from vehicle to vehicle A "vehicle transfer" is the process of moving an automobile from…
Q: Considering the significance of the network to the users' day-to-day activities, choose any three…
A: Introduction: These are the three: 1) dresolution rotosol (R) dresolution rotosol (R) dresolution…
Q: Explain about various Cybercrimes
A: In this question we need to explain different types of cyber crimes.
Q: me code below displays a list of ComparableRectangles sorted by their Area. Explain how would you…
A: Solution: Given, displays a list of ComparableRectangles sorted by their Area. Re-write the code,…
Q: What does it mean for a computer to be in "kernel mode" in the context of operating systems?
A: The kernel of an operating system is a piece of computer code that serves as the system's beating…
Q: Explain the idea of Leaky ReLU (LReLU) node function. Why is it better than ReLU node function ?
A: Let's first take a brief look at the "regular" ReLU where it all begins in order to get closer to…
Q: How does international cooperation affect the management of information? How can digital democracy…
A: Introduction: In order to execute operations effectively, global information management (GIM), a…
Q: consistent with, this model? A. A message can be conceptualized as an event drawn from a sample…
A: SUMMARY The Shannon-Weaver model is one of the earliest and most influential communication models.…
Q: lume Down (): void ow many instance variables does the TV class have? ow many public methods does…
A: Dear Student, The answer to your question is given below -
Q: Exercises of convert NFA to DFA 1- Convert NFA to DFA for following NFA Convert the given NFA to…
A: Solution-1) The transition diagram is as follows:- The transition table of NFA is as follows:- The…
Q: import pandas as pd df = pd.read_csv('data.csv') x = df["Calories"].mean() df["Calories"].fillna(x,…
A: Please find the answer below :
Q: IT Economics and Budget
A: budget is an estimate of income and expenditure for a future period as opposed to an account which…
Q: For the aviation industry, "snapshot isolation" serves as an example of a database design. In the…
A: Snapshot Isolation: A transaction on its private data is never stopped. At any moment, any data…
Q: Write a Python program that asks a user to input expressions (e.g., 5+6) and saves Problem 2 them…
A: import rep='^[0-9]+[+-/*]{1}[0-9]+$'k=input("Enter the Expression : ")while(not(str(k)=="done")):…
Q: In the following cipher a sender of a message has set randomly the cipher alphabet in order to…
A:
Q: Construct DFA The set of binary strings that start with 01 and end with 10. Σ = {0,1}
A:
Q: What is the difference between polling and interrupts?
A: Interrupt An interrupt is an undertaking that shows the computer chip make a brief move. All in all,…
Q: Explain the main parts of an OS in a single word.
A: Introduction: The kernel is the primary processing unit of an operating system (OS) for a computer.…
Q: en it comes to memory, what should an OS be responsible for?
A: Here in this question we have asked that when it comes to memory, what should an OS is responsible…
Q: Hi, I'm having trouble with my Python code using PyCryptdome. I need help fixing my code, I keek…
A: Please see the explanation below:
Q: This piece will define file extensions and identify the programs that generate them. Some concrete…
A: File extensions are the three or four letters at the end of a file name which indicate the format of…
Q: Identify three commonly used protocols inside the company that are either not secure or may be…
A: Introduction A protocol, service, and port that raises security issues because there aren't any…
Q: The components of the operating system that are kept in the memory of the computer are referred to…
A: Dear Student, The answer to your question is given below -
Q: 7. True or False: In general, the size of B(G) is N(n³). 8. True or False: In general, the size of…
A: - We need to talk about the adjacency matrix formed from the undirected graph.
Q: It requires reaching a certain level of expertise and engagement. I
A: The answer is
Q: Provide the one line of code for each of the following: 1. You are given a string from the user. 2.…
A: The code is provided in c++ program
Q: Rectangles” A rectangle can be specified in a 2-dimensional plane using the top left (north west)…
A: A divide and conquer algorithm which refers to the one it is a strategy of the solving a large…
Step by step
Solved in 2 steps
- #this is python programing #topic: OOP Question 2 Design a class called Flower with the instance variables so that after executing the following line of code the desired result shown in the output box will be printed. [You are not allowed to change the code below] #Write your class code here flower1 = Flower() flower1.name="Rose" flower1.color="Red" flower1.num_of_petal=6 print("Name of this flower:", flower1.name) print("Color of this flower:",flower1.color) print("Number of petal:",flower1.num_of_petal) print(“=====================”) flower2 = Flower() flower2.name="Orchid" flower2.color="Purple" flower2.num_of_petal=4 print("Name of this flower:",flower2.name) print("Color of this flower:",flower2.color) print ("Number of petal:",flower2. num_of_petal) #Write the code for subtask 2 and 3 here Output: Name of this flower: Rose Color of this flower: Red Number of petal: 6 ===================== Name of this flower: Orchid Color of this flower: Purple…solve in python Street ClassStep 1:• Create a class to store information about a street:• Instance variables should include:• the street name• the length of the street (in km)• the number of cars that travel the street per day• the condition of the street (“poor”, “fair”, or “good”).• Write a constructor (__init__), that takes four arguments corresponding tothe instance variables and creates one Street instance. Street ClassStep 2:• Add additional methods:• __str__• Should return a string with the Street information neatly-formatted, as in:Elm is 4.10 km long, sees 3000 cars per day, and is in poor condition.• compare:• This method should compare one Street to another, with the Street the method is calledon being compared to a second Street passed to a parameter.• Return True or False, indicating whether the first street needs repairs more urgently thanthe second.• Streets in “poor” condition need repairs more urgently than streets in “fair” condition, whichneed repairs more…IN 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.
- 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()…#this is a python program #topic: OOP A class has been designed for this question. Solve the questions to get the desired result as shown in the output box. [You are not allowed to change the code below] class Wadiya(): def __init__(self): self.name = 'Aladeen' self.designation = 'President Prime Minister Admiral General' self.num_of_wife = 100 self.dictator = True #Write your code for subtask 1, 2, 3 and 4 here Output: Part 1: Name of President: Aladeen Designation: President Prime Minister Admiral General Number of wife: 100 Is he/she a dictator: True Part 2: Name of President: Donald Trump Designation: President Number of wife: 1 Is he/she a dictator: False Subtask: 1) Create an object named wadiya. 2) Use the object to print the values as shown in part 1 (Also print the sentence Part 1) 3) Use the same object to change and print the values in part 2 (Also print the sentence Part 2) 4) Did changing the instance variable values using the same object,…Talking: Heba Abde QUESTION 1: Implement class myTime, this class should: 1) Encapsulate information about the hours (integer), minutes (integer), seconds (integer), AM PM (String) 2) Forbid invalid times, where the following criteria should be considered: - hours are in the range [1 – 12], default is 12. - minutes are in the range [0 – 59], default is 0. - seconds are in the range [0-59], default is 0. - AM PM can only be either “AM" or "PM", default is "AM" If any forbidden value entered, you should set the value to default value. 3) Two different constructors (default and parameterized) 4) A print function that will print the time as (hours : minutes : seconds PM/AM) Example: 02:45:30 PM 6) implement function ticktack, which adds one to the seconds, notice that if seconds is 59 and you add one, it should become 0 and the minutes should be incremented by one, also, if after incrementing minutes by one it becomes 60, it should be set to 0 and hours must be incremented by 1, if after…
- #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):…Which of the statements are true about the class Magazine? 01: class Magazine { 02: public: 03: Magazine (int maxSize = 100); 04: void add (Article a); 05: int numArticles() const; 06: Article getArticle (int i); 07: private: 08: Article* array; 09: int numberOfArticles; 10: }; The compiler will provide a destructor for this class. It has a default constructor It is const-correct. It has a copy constructor The programmer should provide an assignment operatorPlease code in python Create a program with two classes – the person class and the student The person class has the following properties: first name (first_name), last name (last_name) street address (address) city (city) zip code (zip) The class has the following methods: get_full_name, which returns the full name of a person get_full_address, which return greeting, returns a greeting message. The class should provide accessor and mutator for each property The class should override the __str__ method to return the state of the object. Create a child class called student which has a property named graduation year (graduation_year) and major. Provide accessor and mutator for each property of its own It inherits all the properties and methods of the person parent class as well. Create a test program that Create an object of the person class and print the full name of a person. Create an object of the person class and print…
- Please help with the following: C# .NET change the main class so that the user is the one that as to put the name Write a driver class (app) that prompts for the person’s data input, instantiates an object of class HeartRates and displays the patient’s information from that object by calling the DisplayPatientRecord, method. MAIN CLASS---------------------- static void Main(string[] args) { // instance of patient record with each of the 4 parameters taking in a value HeartRates heartRate = new HeartRates("James", "Kill", 1988, 2021); heartRate.DisplayPatientRecord(); // call the method to display The Patient Record } CLASS HeartRATES------------------- class HeartRates { //class attributes private private string _First_Name; private string _Last_Name; private int _Birth_Year; private int _Current_Year; // Constructor which receives private parameters to initialize variables public HeartRates(string First_Name, string Last_Name, int Birth_Year, int Current_Year) { _First_Name =…Create a class Customer with following characteristics and use all concepts which you have learned:Create a class Customer with following characteristics and use all concepts which you have learned: (8) Data Members: String Name, city, country, Int [] cost_array[5], percentg // Cost array contains the price for 5 products Methods: Customer () Percentag() // it calculates and returns percentage cost of all products as each product can have maximum value of 1000. Parametric Constructor //overload it atleast three times. Runner: Create atleast 3 objects and set values. Compare the percentage of all customers and display which customer has higher percentage Data Members: String Name, city, country, Int [] cost_array[5], percentg // Cost array contains the price for 5 products Methods: Customer () Percentag() // it calculates and returns percentage cost of all products as each product can have maximum value of 1000. Parametric Constructor //overload it atleast three…Program - PythonThis is my code for a class. (Question below code)class Pizza:def __init__(self, name):self.name = nameself.toppings = []self.order_status = "Not Ordered"def set_toppings(self, topping_list):self.toppings = topping_listdef get_order_status(self):return self.order_statusdef set_order_status(self, status):self.order_status = status suzie = Pizza("Suzie")larry = Pizza("Larry")suzie_toppings = ["Pepperoni", "Mushroom", "Onion", "Sausage"]suzie.set_toppings(suzie_toppings)suzie.set_order_status("Ordered")larry_toppings = ["Ham", "Pineapple", "Jalapeno", "Olives"]larry.set_toppings(larry_toppings)larry.set_order_status("Ordered")print("Suzie's Order:")print(f"Toppings: {suzie.toppings}")print(f"Order Status: {suzie.get_order_status()}")print("\nLarry's Order:")print(f"Toppings: {larry.toppings}")print(f"Order Status: {larry.get_order_status()}") Question: Create two instance, a first and a second instance with a demo and how it can be used. Then create a menu interface for…