Cr3ate a class named Person, use the __init__ () function to assign values for name and age class Person: def __init__(self, name, age): _______________ _______________ p1 = Person("John", 36) print(p1.name) print(p1.age)
Q: this answer isnt in cpp!?????
A: Here, we have to create a VendingMachine object that performs the following operations: Purchases…
Q: Establish a library. Along with GETMAX, MAXSTACK provides PUSH, POP, and EMPTYSTACK ADT procedures…
A: It is possible to implement a collection with GETMAX requiring only O(1) time complexity. This can…
Q: Do you know what a port number is and how you may utilize it?
A: A port is a number that specifies the host and the service in order to specifically identify a…
Q: Simplify the following Boolean functions. F(w, x, y, z) = xyz + x!yz + x!y!z + xy!z + !w!x!y!z +…
A: Introduction: Boolean algebra is used in digital logic circuits and computer programming. Boolean…
Q: Simplify the following Boolean functions. F(w, x, y, z) = !w!x!y!z + w!x!y!z + wx!y!z + !w!xy!z +…
A: Boolean algebra is an important mathematical tool used in digital logic circuits and computer…
Q: This is the present problem due to the tremendous capability found in today's computers. What are…
A: Given: This is a concern since modern computers are so powerful. What factors contributed to the…
Q: A system administrator's job is to keep production software safe from being broken by updates. Due…
A: Answer is
Q: 3a - Write a regular expression that finds all strings starting with a number between 0 and 299…
A: Solution 3a) Regular Expression Regular expression is the algebraic representation of a regular…
Q: When it comes to computers, what's the primary difference between architecture and structure?
A: Computer organisation 1) Computer Architecture: It describes functional requirements and design…
Q: Exist in the field of software engineering any exclusions that have anything to do with the…
A: Software Reversible Development: Exist any principles in software engineering that are missing?…
Q: The objectives of the test were dissected as part of the usability and user experience testing.
A: Quality of the programme: The phrase "programme quality" describes the fundamental characteristics…
Q: What precisely is meant by the term "code motion"?
A: Code motion is a compiler optimization technique used to improve the performance of computer…
Q: safeguarding of the information technology system Compare the products' levels of confidentiality,…
A: The safeguarding of information technology systems is essential to protect sensitive data and…
Q: What is file protection? How does Linux handle it? OS-related.
A: Given: What exactly is file protection, and how exactly does Linux protect files? (Within the…
Q: In order to hook and chain a FIQ interrupt method, one must begin at the specified offset in the…
A: Introduction: Which Interrupt Vector Table address should you use to connect and chain a FIQ…
Q: Learn everything there is to know about cloud computing and social media blogging.
A: Cloud computing is defined as the delivery of computer services through the internet. Examples:…
Q: Differentiating between the user experience and the actual user interface of a product is essential.…
A: In step 2, I have provided differece between UX and UI In step 3, I have provided list of the…
Q: Can you count the ways that something may be demonstrated? It is best to use a roundabout route when…
A: How many different types of evidence exist? To demonstrate that the sum of two even numbers is also…
Q: What differentiates the following? ICT content creation. Presentation/Visualization Social Media Web…
A: ICT CONTENT CREATION: Content development is a process used to gather information, create material,…
Q: Three fascinating and practical new applications have emerged as a result of the IoT
A: The Internet of Things (IoT) has enabled a wide range of new applications that were not possible…
Q: The interrupt vector table stores a different set of information for each entry.
A: As its name suggests, it is a table that includes vectors. So what precisely are vectors? In…
Q: Changes in technology are unavoidable. Find and analyze five (5) communication or computer-related…
A: Computer trends are modifications or advancements in computer use that propagate widely and are…
Q: Could you perhaps clarify and outline what scalability in the cloud means? How is the scalability of…
A: Let's dissect this idea using a straightforward example from daily life. Everybody owns a…
Q: Message authentication alternatives?
A: In cryptography, a message authentication code (MAC) or tag authenticates communication.…
Q: If in an additive group you have the computation a-pb, where p is a number and a, b are group…
A: To express the computation a - pb in an additive group as a multiplicative computation, we can use…
Q: What is an effect to society identified in terms of artificial intelligence (AI) agricultural A)…
A: AI or artificial intelligence has a hugely promising future in the case of agriculture. Let's see…
Q: To what end do you think file extensions are useful? Please elaborate on your thinking. If you like,…
A: File extensions are useful for several reasons:
Q: what is 8 and 1 as a binary number?
A: Convert 8 into binary: We divide by the base 2 to get the digits from the remainder: Divisionby 2…
Q: In Java: Develop a void function that takes two integers and prints whether the first number is…
A: Solution: Given, In Java: Develop a void function that takes two integers and prints whether the…
Q: Identify the sectors that make use of web engineering, and the difficulties in developing, testing,…
A: Web engineering is used in a variety of sectors including e-commerce, healthcare, banking,…
Q: Do you think IRQ levels will put a key in the keyboard buffer before or after a program creates a…
A: The CPU is alerted to the device's IRQ number by the Interrupt Request submitted via the IRQ number.…
Q: How l create files in folder in vb net
A: Introduction: In VB.NET, creating files in a folder is a straightforward process that involves using…
Q: Can I dispel any misconceptions you may have about email? How does information go from A to B? List…
A: After sending an email, the Mail Transfer Agent receives it (MTA). Simple Mail Transfer Protocol…
Q: Please elaborate so I may learn more about authentication challenge response systems. In contrast to…
A: In the challenge response authentication system, one entity issues a challenge to another, and the…
Q: Discuss the differences between the operating systems of time-sharing and distributed systems.…
A: OS: Operating systems operate computers. Operating systems enable user-computer interactions.…
Q: Question 2 Consider the Library Database consisting of four relations. The library has many…
A: In this question we have to write queries using SQL to retrieve book lists for particular use case.…
Q: Explain why deep access is preferable to shallow access from the point of view of a programmer; do…
A: Justify why deep access is better for programmers, not simply performance. Dynamic scope allocation…
Q: can i get solution for this question
A: I have provided C++ CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT----------------
Q: Noting how information flows across sections of a Web app is crucial.
A: Web applications have these components: Web-based applications, databases, and middleware…
Q: What, exactly, does the phrase "read-only memory" refer to? (ROM)
A: Memory Computer memory is any physical device capable of storing information temporarily, like…
Q: The best way to get a feel for a project is to draw maps of it both with and without the…
A: Software architecture considerations are significant. Solution: Software architecture is a software…
Q: What usually happens when a child process accesses the parent's message buffer through unnamed…
A: That's easy: While the system is not being restarted, a "unnamed" pipe will only exist for as long…
Q: Problem 3. Parameter Passing Consider the following block. Assume dynamic scoping. 1 ( int y; 2 int…
A: ALGORITHM: Declare two integer variables y and z. Assign 6 to y. Define a function f with a…
Q: Data connection protocols usually put the CRC in the trailer instead than the header. Why?..
A: Introduction: Data connection protocols are used to ensure reliable and efficient communication…
Q: An unanswered issue is whether or not the Internet can support two types of application support…
A: The Internet offers two services to its distributed apps: a connection-focused service and a…
Q: The flow of information inside a web application is a fundamental concept to grasp.
A: Data Transmission mode is when two communication devices exchange data. Others call it Data…
Q: Public WiFi's drawbacks?
A: Public WiFi is a convenient and accessible way to connect to the internet, especially when you are…
Q: What mechanism does the linker use to tell the difference between these two overlapping functions?
A: Linkers allow for independent compilation. rather than running a large programme. similar to how a…
Q: You may demonstrate the differences in purpose between RAM and ROM by contrasting their respective…
A: To show the functions of RAM and ROM, it shall be explained: RAM is a kind of volatile memory, which…
Q: Pretend for a moment that you are in control of the police force protecting Kampala. The insights…
A: See the answer: - How can we utilise AI in crime mitigation without harming us?Today, AI detects…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Cr3ate a class named Person, use the __init__ () function to assign values for name and age
class Person:
def __init__(self, name, age):
_______________
_______________
p1 = Person("John", 36)
print(p1.name)
print(p1.age)
Step by step
Solved in 2 steps with 1 images
- Given the provided class, please make the following modifications. class Employee: def __init__(self, name, number): self.name = name self.number = number class ProductionWorker(Employee): def __init__(self, name, number, shift_number, employee_number): Employee.__init__(self, name, number) self.shift_number = shift_number self.employee_number = employee_number # Create an instance of the ProductionWorker class and test itemployee1 = ProductionWorker("John Doe", 1234, 2, 5678)print(employee1.name)print(employee1.number)print(employee1.shift_number)print(employee1.employee_number) Write a class that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object's data attributes. Store the data in the object, then use the object's accessor methods to retrieve it and display it on the screen.Create a class called Line with the followings:1. Private members: p1 and p2 as pointer to Point objects (code provided below), slope and length as double variables2. Define setter and getter functions.3. Define a default constructor that allocate dynamic memory for points andset everything to 0.4. Overload a constructor that allocates memory for points, initilize themwith given arguments, and calculate the slope and length.5. Overload a destructor, a copy constructor and a copy assignment operator.6. Create a function called ”parallel” that return true when given lines areparallel and returns false otherwise7. Overload the less than (<) and greater than (>) and equality (==) oper-ators (compare the length)8. Write a functions that reads lines in the format provided in the lines.txtfrom the file and stores them in a vector named Lines.9. Sort the objects of Lines vector in descending order.10. Extend the functionality of cin and cout for this class11. Write a separate file to…Write a class Distance which has two private data members (int feet,float inches). The class has three constructors which are having no parameter - values of both feet and inches are assigned zero. having two numbers as parameters - the two numbers are assigned as feet and inches respectively. having one number as parameter - both feet and inches are assigned that number. Provide getters and setters for data members. Now write a main class which demonstrate the functionality of above class by calling all constructors, setters & getters. Create 1 object using default constructor, and use setters to set values, then getters to print values. Create a second object using constructor having two parameters, provide values, then print values on screen. Create third object by using third constructor having one parameter, after that print values on screen.
- Write a Program to define a Mobile class, with member variables o String brand; o double price o String OS (make it Final). o Float memory 1. Make a default constructor, 2. Make a parameterized constructor. 3. Overload the above Constructor. 4. Provide getters and setters for data members. 5. Inside main, create an array of mobiles. 6. Take data from user and set the values for the mobiles in array (check for array out of bound exception). 7. At the end Print data of array using Loop. Programming language : JavaThe base class Pet has protected data members petName, and petAge. The derived class Dog extends the Pet class and includes a private data member for dogBreed. Complete main() to: create a generic pet and print information using PrintInfo(). create a Dog pet, use PrintInfo() to print information, and add a statement to print the dog's breed using the GetBreed() function. Ex. If the input is: Dobby2Kreacher3German Schnauzer the output is: Pet Information: Name: Dobby Age: 2Pet Information: Name: Kreacher Age: 3 Breed: German Schnauzer #include <iostream>#include<string>#include "Dog.h" using namespace std; int main() { string petName, dogName, dogBreed; int petAge, dogAge; Pet myPet; Dog myDog; getline(cin, petName); cin >> petAge; cin.ignore(); getline(cin, dogName); cin >> dogAge; cin.ignore(); getline(cin, dogBreed); // TODO: Create generic pet (using petName, petAge) and then call PrintInfo //…create a class called Date that contains data members representing day month, year of a particular date. A. Add a constructor who initializes the value of date as 1/1/2001 and displays the date by calling a member function to-string that represents the date in the form of “Day/Month/year”. B. Output the Date in multiple formats such as a. DD YYYY b. MM/DD/YYYY c. DD.MM.YYYY d. June 14, 2001 C. Use overloaded constructor to create Date objects initialized with dates of the format in part (b). D. Create a Date constructor that reads the system date using standard library function of the <ctime> header and sets the data members. a. https://onlinegdb.com/NaakQKYJI (Refer this code for the usage of ctime) b. C++ Date and Time (tutorialspoint.com) (Go through this for more understanding) E. Add a destructor to the program displaying a suitable msg.
- Write a program to computerize the billing system of a hospital. a) Design the personType class as shown below: PersonTye -firstname: String -lastname: String +print(): void +setNAme(string, string) : void +getFirstName() : string +getLastName() : string +abstract personType(): string b) Design the class doctorType, inherited from the class personType with an additional data member to store a doctor’s speciality. Add appropriate constructors and member functions to initialize, access, and manipulate the data members and this class should implement abstract method of class PersonType. c) Design the class billType with data members to store a patient’s ID and a patient’s hospital charges, such as pharmacy charges for medicine, doctor’s fee, and room charges. Add appropriate constructors and member functions to initialize and access and manipulate the data members. d) Design the class patientType, inherited…Using c++ BankAccount class Given main(), define the BankAccount class (in files BankAccount.h and BankAccount.cpp) that manages checking and savings accounts. The class has three private data members: customer name (string) savings account balance (double) checking account balance (double) Implement the following constructor and public member functions as listed below: BankAccount(string newName, double amt1, double amt2) - set the customer name to parameter newName, set the checking account balance to parameter amt1 and set the savings account balance to parameter amt2. (amt stands for amount) void SetName(string newName) - set the customer name to parameter newName string GetName() - return the customer name void SetChecking(double amt) - set the checking account balance to parameter amt double GetChecking() - return the checking account balance void SetSavings(double amt) - set the savings account balance to parameter amt double GetSavings() - return the savings account…Create a class named Line: (a) Define private data members p1 and p2 as pointer to Point objects (the one we had in lectures), slope and length as double variables. (b) Define setter and getter functions. (c) Define a null-constructor that initializes numeric variables with zero and allocate dynamic memory for points and initialize them to [0,0] as well. (d) Overload a constructor that allocates memory for points, initilize them with given arguments, and calculate the slope and length. (e) Implement destructor, copy constructor and copy assignment operator. (f) Create a function called ”parallel” that takes too Line objects, returns true when given lines are parallel and returns false otherwise. (g) Overload the less than (<) and greater than (>) and equality (==) operators (compare the length). (h) Write a functions that reads lines in the format provided in the lines.txt from the file (without any change) and stores them in a vector named Lines. (i) Sort the objects of Lines…
- Create a base class named Point consisting of x and y data members representing point coordinates. From this class, derive a class named Circle with another data member named radius. For this derived class, the x and y data members represent a circle’s center coordinates. The member functions of the Point class should consist of a constructor, an area() function that returns 0, and a distance() function that returns the distance between two points,(x1,y1) and (x2,y2), where Additionally, the derived class should have a constructor and an override function named area() (PI*pow(radius,2)) that returns a circle’s area. Task: 1-Include the classes constructed in a working C++ program. 2-Have your program call all the member functions in each class. 3- In addition, call the base class’s distance() function with two circle objects and explain the results this function returns.ADD CODE IN LINE 13, where it is written //your code goes below here Assume the following class fully implemented 1. class Olympic2. {3. char* m_name;4. public:5. Olympic(const char* name);6. Olympic(const Olympic& ro);7. Olympic& operator=(const Olympic& ro);8. void setName(const char* name);9. virtual void mission();10. std::ostream& display(std::ostream& os = std::cout);11. virtual ~Olympic();12. };13. std::ostream& operator<<(std::ostream& os, Olympic& r);14. Implement the copy constructor and copy assignment operator of the derived class Runner in a way that derived class and base class' object attributes are properly handled. 1. class Runner :public Olympic2. 3. {4. int m_speed;5. char* m_colour = nullptr;6. public:7. // assume these functions are fully implemented and working perfectly8. Runner(const char* name = "John", const char* c_colour = "blue", int power = 5);9. void setColour(const char* c_colour);10. std::ostream&…7.23 LAB: Product class use Java. Given main(), define the Product class (in file Product.java) that will manage product inventory. Product class has three private member fields: a product code (String), the product's price (double), and the number count of product in inventory (int). Implement the following Constructor and member methods: public Product(String code, double price, int count) - set the member fields using the three parameters public void setCode(String code) - set the product code (i.e. SKU234) to parameter code public String getCode() - return the product code public void setPrice(double p) - set the price to parameter p public double getPrice() - return the price public void setCount(int num) - set the number of items in inventory to parameter num public int getCount() - return the count public void addInventory(int amt) - increase inventory by parameter amt public void sellInventory(int amt) - decrease inventory by parameter amt Ex. If a new Product object is…